What is the right way to set a different <base> for dev/staging/production

前端 未结 6 602
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-10 01:07

for dev and production are different(for production it\'s subfolder). What is the good way to build different base with webp

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 01:35

    the best what I found so far was to put this property in config(HtmlWebpackPlugin option):

    new HtmlWebpackPlugin({
      ...
      baseUrl: process.env.NODE_ENV == 'development'?'/':'/app/'
    })
    

    and then output it in index.html:

    
    

提交回复
热议问题