mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +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);
|
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 = {
|
module.exports = {
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
plugins: [
|
plugins: webpackPlugins,
|
||||||
new DuplicatesPlugin({
|
|
||||||
verbose: true,
|
|
||||||
}),
|
|
||||||
new webpack.EnvironmentPlugin(envObject),
|
|
||||||
new webpack.ContextReplacementPlugin(/moment[\\/]locale$/, /^\.\/(NOT_EXISTING)$/),
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
chainWebpack: config => {
|
chainWebpack: config => {
|
||||||
// Fix issue with duplicated deps in monorepos
|
// Fix issue with duplicated deps in monorepos
|
||||||
|
|||||||
Reference in New Issue
Block a user