-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Webpack devServer options ignored when using au run #794
Comments
I'm not sure if this behavior should be changed. Users familiar with webpack will likely want to completely remove themselves from the aurelia cli environment, and so we might not want to give preference to options in that file. What we might want to do, though, is look at moving the webpack config file in to the |
Alternative solution: a nice commented webpack.config.js file where it is clearly stated that options would be set via cli if used.. |
I agree with @NightWulfe. I just bumped into the same issue. Then I found this issue, so I went to check the aurelia docs here: This section especially suggests that if you need to customize your config, the webpack.config is the place to do that: So if this behaviour will not be changed, at least the docs should be clear on when webpack-dev-server config is used/ignored. |
Although I don't use webpack, I agree overwriting webpack config in run task is difficult for me to follow. BTW, I wrote that newly updated piece of doc for webpack, without really understand the whole setup. The doc needs to be updated to describe how we control webpack config. |
Seems to be working now. |
There is a fix #1088 merged but not released. |
I'm submitting a feature request
[email protected]
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
9.2.0
NPM Version:
5.5.1
Browser:
Firefox
Language:
Typescript
Loader/bundler:
Webpack
Current behavior:
Setting proxy, or other devServer configuration options, in webpack.config.json is ignored when using au run. This is because the run task (tasks/run.ts) creates its own options object and uses that.
What is the expected behavior?
The devServer configuration from webpack.config.json options should be honored. My request is to move the opts configuration from run.ts into webpack.config.json, or at least merge the two configuration when run is invoked.
What is the motivation / use case for changing the behavior?
Users familiar with webpack would be setting devServer options in webpack configuration file. Expecting that this would work, especially since the CLI places some devServer configuration options there, I spent an entire day troubleshooting why I couldn't get my proxy configuration to work. After some help from the gitter chat, I realized that the devServer options were being ignored entirely.
After looking at the run task (tasks/run.ts), I saw that it creates its own server options and completely ignores the options in webpack, using an opts object it creates in the task. After setting my proxy configuration there in run.ts, the proxy works fine.
The text was updated successfully, but these errors were encountered: