/enx-vue-cli-plugin

Primary LanguageJavaScriptMIT LicenseMIT

enx-vue-cli-plugin

Vue CLI plugin for Enx injection during webpack configuration

See Enx docs for front-end usage

Customizing enx options

Override enx options in file vue.config.js:

module.exports = {
  ...
  pluginOptions: {
    enx: {
      cwd: './config',
      debug: true
    },
  },

ESLint

Disable ESLint warnings for enx global variable by setting the following config into your ESLint config file:

globals: {
  enx: true,
}

Vue global variable

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;