GithubHelp home page GithubHelp logo

hjdshu / electron-simple-cli Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 287 KB

这是一个简易的electron开发的脚手架,默认是使用的vue模板vue electron electron-builder

JavaScript 73.48% HTML 8.53% Vue 18.00%

electron-simple-cli's Introduction

这是一个简易的electron开发的脚手架,默认是使用的vue模板

改成react或者其他框架只需要注意保留app里的main.js和preload.js 将其他文件替换为react的开发模板就可以了,另外注意main.js里面的入口加载路径

  // and load the index.html of the app.
  // 开发环境
  if (!app.isPackaged) {
    mainWindow.loadURL('http://localhost:3939/')
    // Open the DevTools.
    mainWindow.webContents.openDevTools()
  } else {
    // 打包环境
    mainWindow.loadFile('./dist/index.html')
  }

目前是在windows电脑上开发测试和开发的,如果是mac,需要注意外面package.json里build的配置

1. 开发: (开发模式只需要用到app目录就可以了)

cd app
yarn 
yarn start

2. 打包:(在最外层目录)

cd app
yarn build
cd ../
yarn 
yarn package

3. 注意打包的时候,终端必须科学上网

cmd下配置
set http_proxy=http://127.0.0.1:xxx
set http_proxys=http://127.0.0.1:xxx

重置
set http_proxy=
set http_proxys=

gitbash/shell下配置

export http_proxy=http://127.0.0.1:xxx
export https_proxys=http://127.0.0.1:xxx

重置
export http_proxy=
export http_proxys=

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.