新建webpack.config.js
webpack.config.js
const path = require('path');
module.exports = {
entry:{
entry:'./src/entry.js',
},
output:{
path:path.resolve(__dirname,'dist'),
filename:'[name].js'
},
}
指定入口和出口文件
path:path.resolve(__dirname,‘dist’),指定出口文件放到dist目录下
filename:’[name].js’指定输出的文件名和入口文件名一样