GithubHelp home page GithubHelp logo

es6's Introduction

ts-src/

es2015 -> transpiler -> es5

use typescript as transpiler

1. npm install typescript -g

// create a tsconfig.json
2. tsc --init

3. tsc -w

******************************************************************

Module Syntax - es2015
Module Loading - working in progress

es6 with webpack5

Presets
https://babeljs.io/docs/presets

create package.json
1. npm init -y

2.
npm i webpack webpack-cli --save-dev

3.
webpack.config.js

4. handle scss
npm i -D sass style-loader css-loader sass-loader

5. use template.html to genereate index.html and insert js into it
npm i -D html-webpack-plugin

6
npm i -D webpack-dev-server

7.to make the code work with old browser, install babel, es6 -> babel-> es5

without babel, generated bundle.js
const generateJoke = () => {
  return "I don't trust stairs. They're alwasy up to something.";
};

with babel, generated bundle.js
var generateJoke = function generateJoke() {
  return "I don't trust stairs. They're alwasy up to something.";
};


npm i -D @babel/core @babel/preset-env babel-loader


8. handle photos and other assets
https://webpack.js.org/guides/asset-modules/

9 axios
npm i axios

10
npm i -D webpack-bundle-analyzer

11. how to create webpack.common.js, webpack.dev.js, webpack.prod.js???

es6's People

Watchers

 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.