mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Storybook: disable DuplicatesPlugin while running in storybook:serve (#13014)
* disable DuplicatesPlugin while running in storybook:serve
This commit is contained in:
@@ -38,16 +38,23 @@ envVars
|
||||
envObject[key] = nconf.get(key);
|
||||
});
|
||||
|
||||
const enableDuplicatesPlugin = process.env.npm_lifecycle_event !== 'storybook:serve';
|
||||
|
||||
const webpackPlugins = [
|
||||
new webpack.EnvironmentPlugin(envObject),
|
||||
new webpack.ContextReplacementPlugin(/moment[\\/]locale$/, /^\.\/(NOT_EXISTING)$/),
|
||||
];
|
||||
|
||||
if (enableDuplicatesPlugin) {
|
||||
webpackPlugins.splice(0, 0, new DuplicatesPlugin({
|
||||
verbose: true,
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
assetsDir: 'static',
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
new DuplicatesPlugin({
|
||||
verbose: true,
|
||||
}),
|
||||
new webpack.EnvironmentPlugin(envObject),
|
||||
new webpack.ContextReplacementPlugin(/moment[\\/]locale$/, /^\.\/(NOT_EXISTING)$/),
|
||||
],
|
||||
plugins: webpackPlugins,
|
||||
},
|
||||
chainWebpack: config => {
|
||||
// Fix issue with duplicated deps in monorepos
|
||||
|
||||
Reference in New Issue
Block a user