Custom generated filename with Angular Cli

前端 未结 6 1081
孤独总比滥情好
孤独总比滥情好 2020-12-24 02:18

With Angular-cli the builded filename is main.[hash].bundle.js when use ng build -prod Is it possible to remove the hash form this filename. So just main.

6条回答
  •  [愿得一人]
    2020-12-24 03:20

    Remove [chunkhash] from the following lines in angular-cli/models/webpack-build-production.js (under node_modules if patching, under packages if forking):

    filename: '[name].[chunkhash].bundle.js',
    sourceMapFilename: '[name].[chunkhash].bundle.map',
    chunkFilename: '[id].[chunkhash].chunk.js'
    

提交回复
热议问题