1

I have a vue project and I use vue-cli-service build to build the project for production.

I noticed by default when I build the files, the resource name are having some kind of version code like

app.34fc5700.js
chunk-vendors.c7da5824.js

Is there a way to get rid of it?

I'm using vue.config.js, there's no webpack.conf.js in my project, and this is how it looks like:

module.exports = {
    publicPath: process.env.VUE_APP_ROOT_PATH,
    outputDir: process.env.VUE_APP_BUILD_DIR,
    chainWebpack: config => {
        config.resolve.symlinks(false);
        config.plugin('html').init((Plugin, args) => {
            const newArgs = {
                ...args[0],
            };
            newArgs.minify && (newArgs.minify.removeAttributeQuotes = false);
            return new Plugin(newArgs);
        });
    },
    css: {
        loaderOptions: {
            sass: {
                additionalData: '@import "@/scss/_variables.scss";',
            },
        },
    }
}

1 Answer 1

1

Looks like the option filenamehashing is something you need. Basically this option is enabled by default so you might need to turn it off:

// vue.config.js
module.exports = {
  filenameHashing: false,
  // ...
};

Sign up to request clarification or add additional context in comments.

3 Comments

Didn't know there's a config for that, thank you!
BTW sounds like we have the same name :) Glad to hear that helps
Lol not surprised, there will be at least 7 people turning their heads around if you call this name on the street.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.