一、静态资源目录改变(默认在dist下面)
默认:
webpack配置
output: { path: path.join(__dirname, ‘./dist‘), filename: ‘build.js‘, chunkFilename: "[id].chunk.js", // publicPath: ‘/dist/‘, },
index.html中
现在需要修改在dist下面,修改后:
webpack配置
output: { path: path.join(__dirname, ‘./dist‘), filename: ‘build.js‘, chunkFilename: "[id].chunk.js", publicPath: ‘/dist/‘, },
index.html中
二、公共代码提取
上为公共代码引入,下为公共代码提取
时间: 2024-11-04 18:54:38