-
Notifications
You must be signed in to change notification settings - Fork 630
Create Demo Server Target #433
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
Conversation
|
|
||
| // add hot-reload related code to entry chunks | ||
| Object.keys(baseWebpackConfig.entry).forEach(function (name) { | ||
| baseWebpackConfig.entry[name] = ['./tool/dev-client'].concat(baseWebpackConfig.entry[name]); |
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.
Not sure if we need to update the name from ./tool/dev-client to ./tool/demo-client
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.
We only have dev-client.js which just includes hot-reload code.
frontend/tool/webpack.demo.config.js
Outdated
| }); | ||
|
|
||
| /** | ||
| * dev config |
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.
demo config
frontend/tool/demo-server.js
Outdated
| _resolve = resolve; | ||
| }); | ||
|
|
||
| console.log('> Starting dev server...'); |
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.
starting demo server.
frontend/tool/demo-server.js
Outdated
| let express = require('express'); | ||
| let webpack = require('webpack'); | ||
| let proxyMiddleware = require('http-proxy-middleware'); | ||
| let webpackConfig = require('./webpack.dev.config'); |
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.
Here is loading the incorrect config. Should update ./webpack.dev.config to ./webpack.demo.config
Note the demo server target shares a large amount of common code with dev server in these files:
webpack.demo.config.js
demo-server.js
start_demo_server.sh
After I gain more experiences in webpack and npm, I will try to merge the common part.
Tracking it here