Add script file to HTML in webpack based on environment

前端 未结 1 1926
春和景丽
春和景丽 2021-01-17 00:40

I\'m trying to add a specific js file to my index.html when bundling my application for production. My webpack.common.js has the following files that get injected into the h

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-17 01:31

    Since I am using webpack-merge and all mandatory files are listed in my webpack.common.js I have solved it by adding an entry element as part of my webpack.prod.js:

    entry:{
          'prodOnlyFile' : './src/file.ts'
      },
    

    0 讨论(0)
提交回复
热议问题