鍍金池/ 問答/HTML/ vue打包之后沒有找到生成的文件

vue打包之后沒有找到生成的文件

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

4、并且從我的webpack.prod.conf.js里的配置看應(yīng)該也會在dist/static/js下生成一個app.xxxxxxxx.js這樣的js文件才對 但是我的沒有生成這個文件
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
}),

唉 困擾很久的問題了

回答
編輯回答
維她命

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

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

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

2018年8月18日 07:26