1.index文件配置
如何webpack打包

2.配置代码:

 // Template for index.html
    index: path.resolve(__dirname, '../../webapp/index.html'),
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'common-app1'),
        filename: 'bundle.js'
    },

    // Paths
    assetsRoot: path.resolve(__dirname, '../../webapp/common-app1'),
    assetsSubDirectory: '',
    assetsPublicPath: 'common-app1/',

3.命令板输入命令:npm run build,然后回车就打包好了。

4.修改打包后文件的chunkhash后缀,只要把chunkhash删除在npm run build回车就好啦

修改前:
如何webpack打包
修改后:
如何webpack打包

相关文章:

  • 2022-02-10
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-01-15
猜你喜欢
  • 2019-05-21
  • 2022-12-23
  • 2021-12-25
  • 2022-01-25
  • 2022-12-23
  • 2021-04-13
相关资源
相似解决方案