Reputation: 305
I have a .env.staging
file with some configs for when I'm building my Vue app for staging.
But if I build now with vue-cli-service build --mode staging
it will not append a hash to the output files, thus there is no cache busting. (Which is does when there is no "mode")
Is there a way of using the env-file, and still have cache busting?
Upvotes: 0
Views: 815
Reputation: 116
The way I accomplished this was to specify the following in the .env.staging file:
NODE_ENV=production
And then in vue.config.js
let config = {};
if(process.env.NODE_ENV !== 'development'){
config.filenameHashing = true;
}
module.exports = config;
Upvotes: 1