Configuration of the Webpack.config.js file: input: module.exports={
Entry://import file, You can make string type such as: './src/script/main.js ' can also use the form of an array such as: ['./src/script/main.js ', './src/script/main1.js ']
Output:{//packaging after the file
Path://__dirname + packaged File-put path for example: __dirname + '/dist '
Filename://the file name after packaging
}
}
[recommended configuration for]webpack.config.js file: input: module.exports={
Entry: {//portal File
Page1: ',//can make string type such as: './src/script/main.js ' can also be used in the form of arrays such as: ['./src/script/main.js ', './src/script/main1.js ']
Page2: "//ibid.
}
Output:{//packaging after the file
Path://__dirname + packaged File-put path for example: __dirname + '/dist '
filename://[name] the file name after packaging for Example: ' [name].js ' three placeholder 1. [name]: replaced by the name of the Block (page1,page2) 2. [hash]: Replace with the compiled hash value of 3. [chunkhash]: replaced by the hash of the block
}
}
Use NPM to add parameters to wabpack: configure Wabpack under scripts in Package.json for example: "webpack": "webpack--config webpack.config.js--progress-- Display-modules--colors--watch "
Webpack Basic Use (ii)