-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Babel in main process with Webpack build #197
Use Babel in main process with Webpack build #197
Conversation
}) | ||
); | ||
config.externals.push('electron'); | ||
config.target = 'node'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use 'electron' as target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed :)
96ff89a
to
58a66aa
Compare
@@ -15,7 +15,7 @@ config.entry = './app/index'; | |||
|
|||
config.output.publicPath = '../dist/'; | |||
|
|||
config.module.loaders.push({ | |||
config.module.loaders = config.module.loaders.concat([{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -10,9 +10,11 @@ | |||
"test-e2e": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register --require ./test/setup.js --require co-mocha ./test/e2e.js", | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -8,7 +8,7 @@ | |||
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-register --recursive --require ./test/setup.js test/**/*.spec.js", | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/register
in dev mode.cc @chentsulin @davej