reasons for the birth of the building
JS Modular
CSS modularity
Webpack Introduction
Methods
compiling ES6
NPM I babel-loader babel-core--save-dev
generator,set,map,array.from,array.prototype.includes
NPM Install @babel/preset-env--save-dev
Global Gasket (for application preparation)
NPM install Babel-polyfill--save
Import " Babel-polyfill "
Local gaskets (prepared for development framework)
will not contaminate the global
Npm install babel-plugin-transform-runtime--save-dev
NPM Install Babel-runtime--save
then set up the related configuration in. babelrc
Compiling typescripts
NPM i typescript ts-loader--save-dev official
Npm i typescript awesome-typescript-loader--save-dev three-party
tsconfig.json< c3/> declaration file (compile in time)
npm I @types/lodash or
npm install typings typings Install Lodash
But we need to add typeroots to the TS file
Packaging Common Code
Commonschunkplugin
Plugins: [
New webpack.optimize.CommonsChunkPlugin ({
Name: ' Common ',
Minchunks:2
})
]
code split lazy load
Webpack methods
ES 2015 Loader spec