brunocodutra / webapp-webpack-plugin

[DEPRECATED] use favicons-webpack-plugin instead
https://www.npmjs.com/package/webapp-webpack-plugin
MIT License
125 stars 17 forks source link

Cache not invalidated properly when changing publicPath #105

Closed aldarund closed 6 years ago

aldarund commented 6 years ago

I have project with nuxt where i set publicPath during build based on env variable.

     extend: function(config, ctx) {
      if (!ctx.isDev) {
        const awsS3AssetsBucketName = `blabla-${
          process.env.STAGE
        }`
        config.output.publicPath = `https://s3.${
          process.env.AWS_REGION
        }.amazonaws.com/${awsS3AssetsBucketName}/`
      }
 }
 }

Even if i change env variable ( so the publicPath changed) webapp-webpack-plugin still output old path until i clean its cache folder.

brunocodutra commented 6 years ago

Thanks for reporting.

For the record, the fix is trivial and only requires adding publicPath to the loader's options.