1 Entry Packaging Portal packing strings and arrays
Const WEBPACK = require (' Webpack '), = require (' path '= { entry: './src/script/ Main.js '//String //entry: ['./src/script/main.js ', './src/script/a.js '],//array Output: { './dist/js '), /// string or array outputs as a single file }};
1.1 Packaging
2 When wrapping objects
Const Webpack = require (' Webpack ' ), path = require (' path ' // './dist/js ' ' hundle.js '//can specify a fixed file
Const WEBPACK = require (' Webpack '), = require (' path '= { // Packing multiple objects main: './src/script/main.js ', './src/script/a.js ' }, output: { './dist/js '), // must separate the output // naming format to ensure that multiple objects are generated }};
or in the format
// naming formats
Each compilation will change regardless of whether the file name is modified
Webpack2 using Ch2-entry and output brief description