在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ vue打包之后沒(méi)有找到生成的文件

vue打包之后沒(méi)有找到生成的文件

1、一般vue打包之后都是生成了一個(gè)dist文件夾 里面有一個(gè)static文件夾和一個(gè)index.html文件
2、在這個(gè)index.html里引入了幾個(gè)webpack生成的js文件 什么vendor manifest之類(lèi)的
3、但是我這個(gè)打包不知道是不是有問(wèn)題 我在indeex.html看到通過(guò)script引入了這幾個(gè)JS文件 但是我在static/js 里沒(méi)有找到vendor.js和main.js啊 其它的JS倒是有 我估計(jì)之前我的項(xiàng)目一直報(bào)webpackJsonp is not defined這個(gè)錯(cuò)誤就跟這里的文件引用有關(guān)系
圖片描述

4、并且從我的webpack.prod.conf.js里的配置看應(yīng)該也會(huì)在dist/static/js下生成一個(gè)app.xxxxxxxx.js這樣的js文件才對(duì) 但是我的沒(méi)有生成這個(gè)文件
new HtmlWebpackPlugin({

  filename: config.build.index,
  template: 'index.html',
  inject: true,
  minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeAttributeQuotes: true
    // more options:
    // https://github.com/kangax/html-minifier#options-quick-reference
  },
  // necessary to consistently work with multiple chunks via CommonsChunkPlugin
  chunks: ['manifest', 'vendor', 'app'],
  chunksSortMode: 'dependency'
}),
// keep module.id stable when vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
  name: 'vendor',
  minChunks: function (module) {
    // any required modules inside node_modules are extracted to vendor
    return (
      module.resource &&
      /\.js$/.test(module.resource) &&
      module.resource.indexOf(
        path.join(__dirname, '../node_modules')
      ) === 0
    )
  }
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
  name: 'manifest',
  minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
  name: 'app',
  async: 'vendor-async',
  children: true,
  minChunks: 3
}),

唉 困擾很久的問(wèn)題了

回答
編輯回答
維她命

webpack的配置文件里output怎么配置的

2018年8月1日 16:58
編輯回答
歆久

解決了嗎?我也遇到同樣的問(wèn)題,困擾我一整天了

2018年8月18日 07:26