npm install --save-dev webpack webpack-cli |
const path = require('path'); | |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist'), | |
}, | |
}; |
module: { | |
rules: [ | |
{ | |
test: /\.css$/, | |
use: ['style-loader', 'css-loader'], | |
}, | |
// 其他Loader设置... | |
], | |
}, |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
// ... | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: './src/index.html', | |
}), | |
// 其他插件设置... | |
], | |
}; |
"scripts": { | |
"build": "webpack --mode production" | |
} |
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |