const {resolve} = require('path')
const htmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')
const AddAssetHtmlWebpackPlugin = require('add-asset-html-webpack-plugin')
module.exports = {
entry: './src/index.js',
output:{
filename: 'built.js',
path: resolve(__dirname,'build')
},
module:{
rules:[
]
},
plugins:[
new htmlWebpackPlugin({
template: './src/index.html'
}),
//无需打包 动态连接
new webpack.DllReferencePlugin({
manifest: resolve(__dirname,'dll/manifest.json')
}),
//自动引入
new AddAssetHtmlWebpackPlugin({
filepath: resolve(__dirname,'dll/jquery.js'),
// 文件输出目录
outputPath: 'auto',
// 脚本或链接标记的公共路径
publicPath: 'auto'
})
],
mode:'production'
}