Use Babel in main process with Webpack build#197
Use Babel in main process with Webpack build#197chentsulin merged 5 commits intoelectron-react-boilerplate:masterfrom
Conversation
webpack.config.electron.js
Outdated
| }) | ||
| ); | ||
| config.externals.push('electron'); | ||
| config.target = 'node'; |
There was a problem hiding this comment.
should use 'electron' as target
96ff89a to
58a66aa
Compare
webpack.config.production.js
Outdated
| config.output.publicPath = '../dist/'; | ||
|
|
||
| config.module.loaders.push({ | ||
| config.module.loaders = config.module.loaders.concat([{ |
There was a problem hiding this comment.
Looks .production.js and .electron.js will have problem of object reference in package.js, so I handle these with array.concat.
463c312 to
ae07363
Compare
|
I just wonder whether |
package.json
Outdated
| "lint": "eslint app test *.js", | ||
| "hot-server": "babel-node server.js", | ||
| "build": "cross-env NODE_ENV=production babel-node ./node_modules/.bin/webpack --config webpack.config.production.js --progress --profile --colors", | ||
| "build-electron": "cross-env NODE_ENV=production babel-node ./node_modules/.bin/webpack --config webpack.config.electron.js --progress --profile --colors", |
There was a problem hiding this comment.
build-main and build-renderer are nicer.
Yes, I can think of case is webpack loader, but it can be resolved by In addition, I recommend webpack build of main process is for production. @chentsulin What do you think? |
|
I'm ok for that. I don't know why but there is a regression about #192. It seems window will open before content ready. |
It's The |
|
Could we somehow fix |
|
Use |
package.json
Outdated
| "test-watch": "npm test -- --watch", | ||
| "test-e2e": "cross-env NODE_ENV=test mocha --compilers js:babel-register --require ./test/setup.js --require co-mocha ./test/e2e.js", | ||
| "lint": "eslint app test *.js", | ||
| "lint": "eslint app test *.js --ignore-pattern main.js", |
There was a problem hiding this comment.
Why not put this in a .eslintignore?
|
I am almost ready to merge this PR. @jhen0409 Could you move |
Related to #139, and just use
-r babel-core/registerin dev mode.cc @chentsulin @davej