-
Notifications
You must be signed in to change notification settings - Fork 364
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
Wait until apply to create inspectpack daemon #215
Conversation
For people running into the "webpack never exits if the dashboard plugin is configured" issue, a workaround is to lazily construct the plugin. For example, in your webpack dev config, instead of creating the plugin and adding it to your // webpack.config.js
const DashboardPlugin = require('webpack-dashboard/plugin');
const devConfig = {
// rest of config as usual...
plugins: [
{
apply: function() {
const dashboard = new DashboardPlugin({color: 'cyan'});
dashboard.apply.apply(dashboard, arguments);
}
}
]
}; |
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.
Approach looks good in general.
Can you also stick a null check / guard in cleanup()
in the weird case that this.inspectpack
is unset?
@tptee -- can you take a look at this one?
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.
👍
@ryan-roemer I pushed a new commit so |
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.
Looks good!
Released in |
This makes it so the dashboard plugin can be configured without creating the inspectpack daemon. If the daemon is created in the constructor, the plugin cannot be conditionally applied. Currently, if the plugin is configured and added as part of a development only config, the process running the production config will never exit. With the changes here, the plugin can be configured but if it is never applied, the webpack process exits properly.
Fixes #96.
Fixes #125.