Skip to content
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

#38 support windows development #114

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/nodemon/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
"**/*.test.*sx",
"**/*.test.*s"
],
"exec": "node -e 'console.clear()'; yarn dev:clean; yarn install && yarn dev:nowatch; true"
"exec": "yarn dev:nowatch"
}
2 changes: 1 addition & 1 deletion config/nodemon/prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
"**/*.test.*sx",
"**/*.test.*s"
],
"exec": "node -e 'console.clear()'; yarn prod:clean; yarn install && yarn prod && yarn prod:serve; true"
"exec": "yarn prod && yarn prod:serve"
}
4 changes: 2 additions & 2 deletions config/webpack/webpack.client.babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default {
compress: true,
disableHostCheck: true,
historyApiFallback: true,
host: '0.0.0.0',
host: '127.0.0.1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will break for people who work on remote machines. Why are these necessary?
It works for me with 0.0.0.0 on Windows 7 VM.
If it is really necessary, please make it configurable through an environment variable and add to .env.example file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On both my windows machines, 0.0.0.0 didn't work. 127.0.0.1 is the standard localhost IP address.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eloisetaylor5693 Could you please patch and verify it for us?
Add and .env variable and set it to 127.0.0.1 by default. Refer to this variable in webpack config. Those who need remote will change the var to 0.0.0.0,
Thanks for your investigation!

hot: true,
lazy: false,
overlay: {
Expand Down Expand Up @@ -360,7 +360,7 @@ export default {
analyze &&
new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerHost: '0.0.0.0',
analyzerHost: '127.0.0.1',
analyzerPort,
openAnalyzer: false,
defaultSizes: 'gzip',
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"module": "src/index.tsx",
"license": "MIT",
"scripts": {
"predev": "node -e 'console.clear()' && yarn install && yarn dev:clean",
"dev": "nodemon --config config/nodemon/dev.json",
"dev:nowatch": "cross-env NODE_ENV=development BABEL_ENV=development babel-node node_modules/.bin/webpack-dev-server --config config/webpack/webpack.client.babel.ts",
"dev:nowatch": "cross-env NODE_ENV=development BABEL_ENV=development webpack-dev-server --config config/webpack/webpack.client.babel.ts",
"dev:clean": "rimraf '../.build/development/{*,.*}' 'node_modules/.cache'",
"prod": "cross-env NODE_ENV=production BABEL_ENV=production babel-node node_modules/.bin/webpack --config config/webpack/webpack.client.babel.ts",
"preprod": "node -e 'console.clear()' && yarn install && yarn prod:clean",
"prod": "cross-env NODE_ENV=production BABEL_ENV=production webpack --config config/webpack/webpack.client.babel.ts",
Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using pre- hooks only makes things even more confusing in my already super-confusing setup. =)
Could we avoid that? As Microsoft folks explained in the issue thread, it is sufficient to just add spaces around semicolons ;.
In fact I was also working on it in parallel and it indeed works.

"prod:clean": "rimraf '../.build/production/{*,.*}' 'node_modules/.cache'",
"prod:serve": "nodemon --quiet --exec babel-node --extensions '.ts' ./src/server/server.ts",
"prod:watch": "nodemon --config config/nodemon/prod.json",
Expand Down