hello-world/
├── web/ //
├──css
├──js
└──index.html
└── main.js //
-
npm init
,generate file package.json -
add to package.json
"devDependencies": {
"electron": "^1.8.4",
}
npm install --save-dev babel-cli babel-preset-es2015
npm install --save-dev rimraf
- 创建
.babelrc
{
"presets": ["es2015"]
}
package.json
"scripts": {
"build": "rimraf ./dist && babel ./web/js --out-dir ./dist/js",
"start": "npm run build && electron ."
},
npm start