Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.16 KB

README_en.md

File metadata and controls

55 lines (41 loc) · 1.16 KB

Vue-Electron

🇨🇳 中文 | 🇬🇧English

This scaffold is built based on VueCli4, vue-cli-plugin-electronic-builder , which is used to quickly build Vue desktop applications.

Start

yarn run serve
yarn run electron:serve

Package

yarn run build
yarn run electron:build

Configuration

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
        })
      }
    }
  }
}

Global variable Config

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

demo

pic