NW.js + Vue-CLI 4 example
- Vue-CLI 4
- Vue 2.6
- Vue-DevTools (latest)
- Jest (100% test coverage)
Why not include Vue-Router or Vuex?
Those are both very easily added from the Vue-CLI. There is also no custom styling libraries (Bulma, Bootstrap, etc), or meta-languages (Sass, TS, Pug, etc), or component libraries (Vuetify, Inkline, etc). This is repo is meant to be the "go to" option for building all desktop apps with Vue. So it avoids pushing any particular choices on to you. With the exception of testing being set up for Jest, and Linting being set up to ensure minumum quality of this boilerplate repo itself. Both of which can be easily modified, ignored, or removed.
Running Locally for development
- An empty window will pop up while Webpack warm ups
- Once Webpack is running, refresh the window and you're golden
Building for distribution
npm run build:cleanwill delete your
npm run build:vuewill build just your Vue app for distribution (
npm run build:nwwill build just your NW.js app (
npm run buildis your all-in-one command. It will clean out the old dist folders and build your Vue and NW.js app
IMPORTANT NOTE ABOUT BUILDS!!!
They take a long time. If you do
npm run build expect it to take 10-30 minutes. This can be adjusted by changing the build params in the
package.json. The more platforms and build types, the longer it takes. You can also remove the
--concurrent from the
build:nw script to see a status of what has been completed. This will allow individual pieces to finish faster, but the entire build will take longer.
Automated quality enforcment
npm run lint- Uses rules in
- Unit tests:
npm run test:unit- Jest.
npm run test:e2e- Accepting PR to make tests run in NW.js. - Nightwatch.
Want Vue-Router? Vuex? Use the Vue-CLI to add them:
To update your version of Vue-DevTools run
npm run update:vue-devtools.
This will download the source code for the latest version of Vue-DevTools and do a custom build for NW.js. This ensures you always have the latest version.
- nwjs-vue - Uses Vue-CLI 2
- vue-desktop-basic - Does not use a build system at all, all
.vuefiles run directly in the browser context
Maintainence of this repo
This is not for those using this repo, but for those maintaining it.
- When updating the version of NW.js devDependency, also update these:
npm run regressionafter updating dependencies or other major changes to verify builds still work correctly