This project was bootstrapped with Create React App.
DvaJS React and redux based, lightweight and elm-style framework.
git clone --depth 1 --single-branch --branch master https://github.com/ctocto/electron-react-dva-boilerplate.git your-project-name
And then install the dependencies with npm
$ cd your-project-name
$ npm i
$ npm i -g foreman // http://strongloop.github.io/node-foreman/
$ npm start
To package apps for the local platform:
$ npm run dist
https://www.npmjs.com/package/eslint-import-resolver-alias
const path = require('path')
const {
override,
} = require('customize-cra')
module.exports = {
paths(paths, env) {
paths.appIndexJs = path.resolve(__dirname, 'app/index.js')
paths.appSrc = path.resolve(__dirname, 'app')
return paths
},
}
'@pages/Demo' should be listed in the project's dependencies. Run 'npm i -S @pages/Demo' to add it import/no-extraneous-dependencies
have no alternative
"import/no-extraneous-dependencies": [0]
Creating an optimized production build...
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
https://stackoverflow.com/questions/52888214/how-to-set-environment-variable-in-react-js
"build": "set \"CI=false\" && react-app-rewired build",
or
.travis.yml
env:
global:
- CI=false
.appveyor.yml
install:
- ps: Install-Product node 12 x64
- set CI=false
- npm install
appveyor CI
,travis CI
No settings required conditional-releases
3 |
4 | var pathFile = path.join(__dirname, 'path.txt')
5 |
> 6 | if (fs.existsSync(pathFile)) {
7 | module.exports = path.join(__dirname, fs.readFileSync(pathFile, 'utf-8'))
8 | } else {
9 | throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
electron/electron#9920 (comment)
npm i -D nodemon
// scripts
"electron": "nodemon --watch src --exec 'electron .'",
https://stackoverflow.com/questions/39250387/sync-code-changes-in-electron-app-while-developing
- electron 6.0 macOS Unexpected exit
- ✅ update
electron-builder@^21.2.0
- ✅ update
- build main code
- ✅
"build-main": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.js --colors"
- ✅
- webpack
externals
import/no-unresolved
- ❓