webpack插件

webpack的 UglifyJsPlugin压缩插件完成CSS,JS 代码压缩

webpack怎么引入第三方的库?
拿jQuery为例:
entry: {
page: ‘path/to/page.js’,
jquery: ‘node_modules/jquery/dist/jquery.min.js’
}
new HtmlWebpackPlugin({
filename: ‘index.html’,
template: ‘index.html’,
inject: true,
chunks: [‘jquery’, ‘page’] // 按照先后顺序插入script标签
})
HtmlWebpackPlugin 将生成的js自动加入到html中

你可能感兴趣的:(webpack)