GithubHelp home page GithubHelp logo

pox4 / simple-todo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dacodemaniak/simple-todo

0.0 1.0 0.0 1.63 MB

Build web apps from HTML / CSS / TypeScript

CSS 0.16% JavaScript 98.31% HTML 0.52% TypeScript 1.00%

simple-todo's Introduction

simple-todo

Build web apps from HTML / CSS / TypeScript

Requirements

Prepare environment

$ mkdir ~/javascript-workspace/simple-todo

$ cd ~/javascript-workspace/simple-todo

$ npm init

$ touch .gitignore

$ echo "node_modules" >> .gitignore

$ git init

Install dev dependencies

$ npm i typescript@latest --save-dev

$ npm i babel@latest babel-cli@latest babel-core@latest --save-dev

$ npm i @babel/core@latest @babel/preset-env@latest --save-dev

$ npm i webpack@latest webpack-cli@latest --save-dev

$ npm i ts-loader@latest --save-dev

$ npm i @types/jquery --save-dev

Install dependencies

$ npm i jquery@latest --save

$ npm i bootstrap@latest --save

$ npm i moment@latest

Configure builder

$ nano package.json

Put the following in the "scripts" attribute :

   "scripts": {
    "babel": "babel --presets es2015 src/app.ts -o build/bundle.js",
    "webpack:dev": "webpack --watch --mode=development",
    "webpack:prod": "webpack --watch --mode=production"
},

Configure TypeScript

$ nano tsconfig.json

Put the following :

{
  "compilerOptions": {
       "baseUrl": ".",
       "paths": { "*": ["types/*"] },
       "outDir": "./dist/",
       "noImplicitAny": true,
       "module": "es6",
       "target": "es2015",
       "allowJs": true,
       "lib": ["dom", "dom.iterable", "es6", "es2015.promise"]
  }
}

Configure webpack options

$ nano webpack.config.js

Put the following :

var path = require('path');
var webpack = require('webpack');

module.exports = {
    entry: './src/app.ts',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: "[name].bundle.js",
        chunkFilename: "[name].chunk.js"
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                query: {
                    presets: ['es2015']
                }
            },
            {
                test: /\.tsx?$/,
                use: 'ts-loader',
                exclude: /node_modules/
            }
        ]
    },
    resolve: {
        extensions: [
            '.ts',
            '.js',
            '.tsx'
        ]
    },
    devtool: 'source-map'
};

simple-todo's People

Contributors

dacodemaniak avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.