-
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.
fix(storybook): upgrade to webpack5 (#810)
* upgrade webpack for storybook * use webpack.config from storybook and override rules * add HtmlWebpackPlugin * Fix storybook path aliases * use latest version of storybook Co-authored-by: Michael Puehringer <[email protected]> Co-authored-by: Michael Pühringer <[email protected]>
- Loading branch information
1 parent
9297e07
commit 9d92de2
Showing
2 changed files
with
22 additions
and
21 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,24 +1,22 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
stories: [ | ||
"../src/**/*.stories.mdx", | ||
"../src/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
"@storybook/preset-scss" | ||
], | ||
framework: "@storybook/react", | ||
core: { | ||
builder: 'webpack5', | ||
}, | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/preset-scss', 'storybook-addon-swc'], | ||
framework: '@storybook/react', | ||
webpackFinal: async (config) => { | ||
// Add tdp_core/dist as alias, as we have scss/code imports like tdp_core/dist/assets/... | ||
// These can only be resolved in a workspace currently, and not in the standalone repo. | ||
config.resolve.alias = { | ||
...(config.resolve.alias || {}), | ||
'tdp_core/dist': path.resolve(__dirname, '../', 'dist') | ||
// I have no clue why this is required, but if this is missing we get a "Can't resolve '../../assets/icons/datavisyn_logo.svg' in '.../src/scss'"" | ||
'../../assets': path.resolve(__dirname, '../src/assets'), | ||
// Add tdp_core/dist as alias, as we have scss/code imports like tdp_core/dist/assets/... | ||
'tdp_core/dist': path.resolve(__dirname, '../src'), | ||
'tdp_core/src': path.resolve(__dirname, '../src'), | ||
'tdp_core': path.resolve(__dirname, '../src'), | ||
}; | ||
return config; | ||
}, | ||
} | ||
}; |
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