Inject env chunk to head with global function $getEnv
embed process.env when using the html webpack plugin
yarn add html-webpack-env-plugin -D
const HtmlWebpackEnvPlugin = require('html-webpack-env-plugin')
{
chainWebpack: config => {
config.plugin('html-webpack-env').use(HtmlWebpackEnvPlugin, [
{
outputName: 'js/env.development.js', // deaults to 'js/env.js'
matcher: /^(VUE_APP|CI|APP)_/
}
])
}
}
MIT Copyright (c) Allex Wang