1. 程式人生 > >webpack 1.x 之配置的坑

webpack 1.x 之配置的坑

blog .html 現在 file output col strong html中 logs

一、靜態資源目錄改變(默認在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中

技術分享

二、公共代碼提取

技術分享

上為公共代碼引入,下為公共代碼提取

webpack 1.x 之配置的坑