We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using webpack.config with multiple targets, only files from first configuration are served. For files from second config I'm getting 404 error.
const webpack = require('webpack'); const path = require('path'); module.exports = [ { name: 'mobile', entry: { mobile: ['webpack-hot-middleware/client?name=mobile', './mobile.js'] }, output: { path: path.join(__dirname, 'build', 'mobile'), filename: '[name].js', publicPath: '/' } }, { name: 'desktop', entry: { desktop: ['webpack-hot-middleware/client?name=desktop', './desktop.js'] }, output: { path: path.join(__dirname, 'build', 'desktop'), filename: '[name].js', publicPath: '/' }, } ]
If I swap configs places (i.e. move desktop to be first element of array and mobile is second) then I can request files only for desktop bundle.
desktop
After some testing, I understood that if I delete publicPath from first config, then bundle only from 2nd config is served.
publicPath
Conclusion: . webpack-hot-middleware serves only entries defined in first config (of array of configs) with puclicPath property included.
webpack-hot-middleware
puclicPath
P.S.: On express side I have this:
app.use(require("webpack-dev-middleware")(compiler, { noInfo: true, publicPath: "/" })); app.use(require("webpack-hot-middleware")(compiler));
The text was updated successfully, but these errors were encountered:
I'd need to see more of your config to help.
Hot middleware itself doesn't serve up any of your files - that's dev-middleware' job. So the problem will be config related
Sorry, something went wrong.
This issue is related to this:
webpack/webpack-dev-middleware#151 webpack/webpack-dev-server#641
Closing it
No branches or pull requests
When using webpack.config with multiple targets, only files from first configuration are served. For files from second config I'm getting 404 error.
If I swap configs places (i.e. move
desktop
to be first element of array and mobile is second) then I can request files only for desktop bundle.After some testing, I understood that if I delete
publicPath
from first config, then bundle only from 2nd config is served.Conclusion: .
webpack-hot-middleware
serves only entries defined in first config (of arrayof configs) with
puclicPath
property included.P.S.: On express side I have this:
The text was updated successfully, but these errors were encountered: