To install or update nvm, you can use the install script using cURL:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
or Wget:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
The script clones the nvm repository to ~/.nvm
and adds the source line to your profile (~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
).
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
Any issues with NVM install can be solved by reading their README.
Install node
version 8 using nvm
:
$ nvm install 8
Electron has certain dependencies on each system and those need to be installed for Electron to build correctly.
After those dependencies are taken care of, we can finally grab the source code for this project and have it grab it's dependencies:
$ git clone https://github.com/opensprints/opensprints-electron.git
$ cd opensprints-electron
$ npm install
$ npm run dev
$ npm run package
Linux:
$ npm run package-linux
Mac:
$ npm run package-mac
Also to create a Mac installer .dmg
after package:
$ npm run create-installer-mac
Windows:
$ npm run package-win
To package apps for all platforms:
$ npm run package-all
To package apps with options:
$ npm run package -- --[option]
After build, you will find your build in release-builds
folder.
- --name, -n: Application name (default: ElectronReact)
- --version, -v: Electron version (default: latest version)
- --asar, -a: asar support (default: false)
- --icon, -i: Application icon
- --all: pack for all platforms
test
, tools
, release
folder and devDependencies in package.json
will be ignored by default.
If you use any 3rd party libraries which can't be built with webpack, you must list them in your webpack.config.base.js
:
externals: [
// put your node 3rd party libraries which can't be built with webpack here (mysql, mongodb, and so on..)
]
You can find those lines in the file.
This boilerplate out of the box is configured to use css-modules.
All .css
file extensions will use css-modules unless it has .global.css
.
If you need global styles, stylesheets with .global.css
will not go through the
css-modules loader. e.g. app.global.css
MIT © OpenSprints