Vue CLI plugin for Enx injection during webpack configuration
See Enx docs for front-end usage
Override enx options in file vue.config.js
:
module.exports = {
...
pluginOptions: {
enx: {
cwd: './config',
debug: true
},
},
Disable ESLint warnings for enx
global variable by setting the following config into your ESLint config file:
globals: {
enx: true,
}
Consider inject enx variable into your Vue instance using your main Vue App props (so you'd access it through this.$root.enx
) or using Vue prototype as below:
// main.js
Vue.prototype.enx = enx;
// any component or view file
const anyConfig = this.enx.config;