-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds aliases to Storybooks webpack config for emotion 10 packages.
- Loading branch information
1 parent
85a510d
commit 62465d1
Showing
1 changed file
with
22 additions
and
0 deletions.
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 |
---|---|---|
@@ -1,6 +1,28 @@ | ||
const path = require("path"); | ||
|
||
// Location of root node_modules | ||
const modulesDir = path.join(__dirname, '../node_modules'); | ||
|
||
// As long Storybook depends on emotion 10. | ||
const emotion10Aliases = (config) => ({ | ||
...config, | ||
resolve: { | ||
...config.resolve, | ||
alias: { | ||
...config.resolve.alias, | ||
'@emotion/core': path.join(modulesDir, '@emotion/react'), | ||
'@emotion/styled': path.join(modulesDir, '@emotion/styled'), | ||
'@emotion/styled-base': path.join(modulesDir, '@emotion/styled'), | ||
'emotion-theming': path.join(modulesDir, '@emotion/react'), | ||
}, | ||
}, | ||
}); | ||
|
||
|
||
module.exports = { | ||
stories: [ | ||
'../src/**/*.stories.@(ts|tsx)', | ||
], | ||
addons: [], | ||
webpackFinal: emotion10Aliases, | ||
}; |