This scaffold is built based on VueCli4, vue-cli-plugin-electronic-builder , which is used to quickly build Vue desktop applications.
yarn run serve
yarn run electron:serve
yarn run build
yarn run electron:build
module.exports = {
// Other configuration
chainWebpack: config => {},
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {},
chainWebpackRendererProcess: config => {
config.plugin('define').tap(args => {
const env = args[0]['process.env']
for (let key in env) {
args[0][`process.env.${key}`] = env[key]
}
delete args[0]['process.env']
return args
})
}
}
}
}
gets the value assigned by the corresponding configuration file
desktop: .vue-conf/config.json in the current user directory
Web side: the project directory public/config/config json