This repository has been archived by the owner on Aug 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply suggested workaround artisanofcode-archive/storybook-preset-cra…
- Loading branch information
Mikko Ankkala
committed
Apr 4, 2022
1 parent
9ebea39
commit aba3006
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const cracoConfig = require('../craco.config'); | ||
|
||
/** | ||
* Add a plugin to remove ModuleScopePlugin from webpack when running storybook because it messes | ||
* with storybook-preset-craco. | ||
*/ | ||
|
||
cracoConfig.plugins.push({ | ||
plugin: { | ||
overrideWebpackConfig: ({ webpackConfig }) => { | ||
webpackConfig.resolve.plugins = webpackConfig.resolve.plugins.filter( | ||
(plugin) => plugin.constructor.name !== 'ModuleScopePlugin' | ||
); | ||
|
||
return webpackConfig; | ||
}, | ||
}, | ||
}); | ||
|
||
module.exports = cracoConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module.exports = { | ||
// Nothing here in particular | ||
plugins: [] | ||
}; |