-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
writeToDisk doesn't work with multiple targets #2771
Comments
Please provide full configurations |
I can't unfortunately (it's for a closed source app). Do you have a test config that has multiple targets somewhere? |
@Timmmm Yes, and all works fine, please provide minimum configuration, we don't need you full configuration |
I'm seeing the same issue. I've created a repo and steps to reproduce to help demonstrate the problem: https://github.com/JohnStarich/webpack-multi-writeToDisk Here are the configs for convenience:
module.exports = [
require('./webpack.config.ui.js'),
require('./webpack.config.api.js'),
]
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'production',
entry: './src/ui/index.js',
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 9000
},
plugins: [
new HtmlWebpackPlugin({
title: 'Hello webpack',
}),
],
};
const path = require('path');
module.exports = {
mode: 'production',
entry: './src/api/index.js',
target: 'node',
devServer: {
writeToDisk: true,
},
output: {
path: path.resolve(__dirname, 'dist', 'api'),
},
}; |
I also noticed a separate issue: For some reason, setting the |
@JohnStarich |
Got it, thanks for clarifying! For the |
No issues 😄 |
How exactly Like: // webpack.config.js
module.exports = [
{
devServer: {
port: 1234,
publicPath: '/'
}
},
{
devServer: {
port: 5678,
publicPath: '/test/'
}
},
{
// don't want to use devServer
devServer: false,
target: 'node'
}
]; |
@Airkro Sorry for delay, you can don't set |
@webpack/cli-team we need to allow set |
On it 👍 |
Close in favor #2408 |
webpack version: 4.43.0
webpack-cli version: 3.3.11
webpack-dev-server version: 3.11.0
Node.js version: 14.0.0
Operating System: MacOS 10.14.6
If you have a webpack.config.js that exports multiple targets, e.g:
And you set this in one of them:
Then no files are written to disk - the behaviour is identical to not setting it. If you add that setting to both targets then it correctly writes everything out to disk. But I would have expected that you can set that option in different targets separately.
Expected Behavior
It should write files to disk.
Actual Behavior
It does not write files to disk.
For Bugs; How can we reproduce the behavior?
Run
webpack-dev-server
with multiple targets, only one of which haswriteToDisk
set.The text was updated successfully, but these errors were encountered: