-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 Multiple Targets #1256
Comments
Turned out to be such, no add: // webpack.config.js {
+ entry: (devClient) => {
+ return {
+ app: './src/setup.server',
+ };
+ },
output: {
path: path.resolve(__dirname, 'dist/server')
filename: 'app.js',
chunkFilename: '[name].js',
libraryTarget: 'commonjs2'
},
target: 'node'
} The update cannot be used: |
So for the Node target it shouldn't auto-add the |
I want to creating isomorphic apps, which contains two webpack configuration files, one for client app and one for server-side app. The server side app runs in a node environment, so the |
Yes, but I was wondering if there are valid use cases where you do need these |
The Node target add https://github.com/webpack/webpack-dev-server/blob/master/client-src/default/index.js file. |
Okay thanks for finding out. Could you make a PR and add a test for this? |
Sorry, I question write wrong. I make PR and test at tomorrow. Thanks! |
+1 I am also experiencing the same thing. @SpaceK33z what's the status on merging @sanonz PR? |
Fixed in #1775 |
Code
Run
Expected Behavior
The client app entry addwebpack/hot/only-dev-server
webpack/hot/dev-server
etc.Actual Behavior
All added.
For Bugs; How can we reproduce the behavior?
Example edit: https://github.com/webpack/webpack-dev-server/blob/master/lib/util/addDevServerEntrypoints.js#L22
[].concat(webpackOptions).forEach((wpOpt) => { + if (wpOpt.target === 'node') return; if (typeof wpOpt.entry === 'object' && !Array.isArray(wpOpt.entry)) { Object.keys(wpOpt.entry).forEach((key) => { wpOpt.entry[key] = devClient.concat(wpOpt.entry[key]); }); } else if (typeof wpOpt.entry === 'function') { wpOpt.entry = wpOpt.entry(devClient); } else { wpOpt.entry = devClient.concat(wpOpt.entry); } });
For Features; What is the motivation and/or use-case for the feature?
server side rendering
The text was updated successfully, but these errors were encountered: