[Vuejs]-How to get `webpack.config.js` or `vue.config.js` file data globally in VueCLI 3

0👍

It not recommend to use data in vue.config.js directly. If you have some variables based on environment, use Modes and Environment Variables.

0👍

Its not recommended method even if you need to do that just try this.

import vueconfig from "./../vue.config.js";
new Vue({
    data:{
        config
    }
})

one thing you remember that we can’t define custom data in vue.config.js see this , If you want custom config rename the file.

Leave a comment