-
Notifications
You must be signed in to change notification settings - Fork 11
refactor: extract process.kill to stopServer method #30
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
Conversation
|
|
|
How is it now? |
atassis
left a comment
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.
LGTM now
|
I am preparing to some medical interventions, will publish a new version in between preparations (today) |
|
Good luck :] |
|
|
|
It works as expected, function runScriptPlugin(): RsbuildPlugin {
return {
name: 'run-script-webpack-plugin',
setup: (api) => {
let runServerPlugin;
api.modifyRspackConfig((config, { isDev }) => {
if (!isDev) {
return;
}
runServerPlugin = new RunScriptWebpackPlugin({
name: 'server.js',
autoRestart: false,
restartable: false,
signal: false,
nodeArgs: process.env.INSPECT ? ['--inspect'] : [],
});
config.plugins.push(runServerPlugin);
});
api.onCloseDevServer(() => {
runServerPlugin?._stopServer({ force: true }); // needed since signal must be false for HMR
});
},
};
} |
|
I won't be available to do anything this week, but you are free to create a PR, I'll check it later. Doesn't look it ld break anything, so I might approve this change |
I need this method for a rsbuild adapter...
When rsbuild restarts the dev-server, this plugin doesn't closes the running server....