wizard: prepare a dev env to create the new wizard
Developing a new wizard will require many pull requests and some of them might even be worked on in parallel. To allow to develop all of that without interfering with the legacy wizard this commit introduces a new dev environment alongside an unleash flag when we later want to do the switch. To use the new dev en use `npm run stage-beta:experimental` or `npm run stage-beta:msw+experimental` depending on what you want. Then unleash flag to toggle in stage and prod is: `image-builder.new-wizard.enabled` fixes: HMS-2859
This commit is contained in:
parent
0bcb8217cb
commit
9a1b823eed
4 changed files with 44 additions and 1 deletions
|
|
@ -106,6 +106,29 @@ if (process.env.MSW) {
|
|||
plugins[definePluginIndex] = newDefinePlugin;
|
||||
}
|
||||
|
||||
if (process.env.EXPERIMENTAL) {
|
||||
/*
|
||||
We would like the client to be able to determine whether or not it is in
|
||||
experimental mode at run time based on the value of process.env.EXPERIMENTAL.
|
||||
We can add that variable to process.env via the DefinesPlugin plugin, but
|
||||
DefinePlugin has already been added by config() to the default webpackConfig.
|
||||
|
||||
Therefore, we find it in the `plugins` array based on its type, then update
|
||||
it to add our new process.env.EXPERIMENTAL variable.
|
||||
*/
|
||||
const definePluginIndex = plugins.findIndex(
|
||||
(plugin) => plugin instanceof webpack.DefinePlugin
|
||||
);
|
||||
const definePlugin = plugins[definePluginIndex];
|
||||
|
||||
const newDefinePlugin = new webpack.DefinePlugin({
|
||||
...definePlugin.definitions,
|
||||
'process.env.EXPERIMENTAL': true,
|
||||
});
|
||||
|
||||
plugins[definePluginIndex] = newDefinePlugin;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
...webpackConfig,
|
||||
plugins,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue