第一章: webpack 与构建发展简史
https://github.com/cpselvis/geektime-webpack-course
1. 为什么需要构建工具
2. 前端构建演变之路
3. 初识 webpack
module.exports = {
entry: './src/index.js', // 打包入口文件
output: { // 打包的输出
path: path.join(__dirname, './dist'),
filename: 'bundle.js'
},
mode: 'production', // 环境
module: {
rules: [ // loader 配置
{
test: /\.txt$/,
use: 'raw-loader'
}
]
},
plugins: [ // 插件配置
new HtmlWebpackPlugin({
template: './src/index.html'
})
]
}3.1 零配置的 webpack
4. 安装 webpack
Last updated