├── .npmignore ├── src ├── main.js ├── cli.js └── es6-init.js ├── .babelrc ├── .jshintrc ├── .gitignore ├── README.md └── package.json /.npmignore: -------------------------------------------------------------------------------- 1 | test-dist/ 2 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // Just a sanity check, if you want the value out of `electron`, you'll need to get it yourself. 2 | import 'electron'; 3 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2016-node5", "react"], 3 | "plugins": ["transform-async-to-generator", "array-includes"], 4 | "sourceMaps": "inline" 5 | } 6 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "es5": true, 3 | "esnext": true, 4 | "eqeqeq": true, 5 | "eqnull": true, 6 | "expr": true, 7 | "latedef": true, 8 | "onevar": true, 9 | "noarg": true, 10 | "node": true, 11 | "trailing": true, 12 | "undef": true, 13 | "unused": true, 14 | "browser": true 15 | } 16 | -------------------------------------------------------------------------------- /src/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import electron from 'electron'; 4 | import proc from 'child_process'; 5 | 6 | let params = [require.resolve('./es6-init')].concat(process.argv.slice(2)); 7 | 8 | let child = proc.spawn(electron, params, {stdio: 'inherit'}); 9 | child.on('close', (code) => process.exit(code)); 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git 27 | node_modules 28 | 29 | lib 30 | test-dist 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # electron-prebuilt-compile 2 | 3 | [](http://unmaintained.tech/) 4 | 5 | electron-prebuilt-compile is a drop-in replacement for [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) that natively understands ES6 + React + LESS + some other languages, powered by [electron-compile](https://github.com/electronjs/electron-compile). 6 | 7 | ## Installation 8 | 9 | Download and install the latest build of electron for your OS and add it to your projects `package.json` as a `devDependency`: 10 | 11 | ``` 12 | npm install electron-prebuilt-compile --save-dev 13 | ``` 14 | 15 | Now you can just run `electron` to run electron: 16 | 17 | ``` 18 | electron 19 | ``` 20 | 21 | Electron will now understand ES6/ES7 and React components out-of-the-box, even in inline HTML: 22 | 23 | ```html 24 |
25 | 26 | 27 | 28 | 29 | 36 | 37 |