Skip to content

Commit 5a76ea9

Browse files
committed
get storybook to build again in a webpack 5 world
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent 22ba57a commit 5a76ea9

File tree

5 files changed

+32
-21
lines changed

5 files changed

+32
-21
lines changed

web-app/.storybook/.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
["react-app", { "flow": false, "typescript": true }],
5+
"@emotion/babel-preset-css-prop"
6+
]
7+
}

web-app/.storybook/addons.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import '@storybook/addon-actions/register'
2-
import '@storybook/addon-knobs/register'
3-
import '@storybook/addon-links/register'
1+
import '@storybook/addon-actions'
2+
import '@storybook/addon-knobs'
3+
import '@storybook/addon-links'

web-app/.storybook/webpack.config.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,10 @@ module.exports = ({ config }) => {
1212
config.module.rules.push({
1313
test: /\.(ts|tsx)$/,
1414
loader: require.resolve('babel-loader'),
15-
options: {
16-
plugins: [
17-
new MiniCssExtractPlugin(),
18-
[
19-
'babel-plugin-import',
20-
{
21-
libraryName: '@alifd/next',
22-
style: true,
23-
},
24-
],
25-
],
26-
presets: [
27-
// react-app
28-
['react-app', { flow: false, typescript: true }],
29-
// allow emotion css prop on html
30-
['@emotion/babel-preset-css-prop'],
31-
],
32-
},
3315
})
3416

3517
config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))
18+
// config.plugins.push(['import', { libraryName: '@alifd/next', libraryDirectory: 'lib', style: true }])
3619

3720
config.resolve.extensions.push('.ts', '.tsx')
3821

web-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@babel/core": "7.14.0",
48+
"@babel/helper-environment-visitor": "7.16.7",
4849
"@storybook/addon-actions": "6.4.0",
4950
"@storybook/addon-knobs": "6.4.0",
5051
"@storybook/addon-links": "6.4.0",

web-app/yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@
415415
resolve "^1.14.2"
416416
semver "^6.1.2"
417417

418+
"@babel/helper-environment-visitor@7.16.7":
419+
version "7.16.7"
420+
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7"
421+
integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==
422+
dependencies:
423+
"@babel/types" "^7.16.7"
424+
418425
"@babel/helper-explode-assignable-expression@^7.12.13":
419426
version "7.13.0"
420427
resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz#17b5c59ff473d9f956f40ef570cf3a76ca12657f"
@@ -825,6 +832,11 @@
825832
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389"
826833
integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==
827834

835+
"@babel/helper-validator-identifier@^7.16.7":
836+
version "7.16.7"
837+
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad"
838+
integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==
839+
828840
"@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5":
829841
version "7.9.5"
830842
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80"
@@ -2804,6 +2816,14 @@
28042816
"@babel/helper-validator-identifier" "^7.15.7"
28052817
to-fast-properties "^2.0.0"
28062818

2819+
"@babel/types@^7.16.7":
2820+
version "7.17.0"
2821+
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b"
2822+
integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==
2823+
dependencies:
2824+
"@babel/helper-validator-identifier" "^7.16.7"
2825+
to-fast-properties "^2.0.0"
2826+
28072827
"@babel/types@^7.3.3":
28082828
version "7.10.5"
28092829
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.5.tgz#d88ae7e2fde86bfbfe851d4d81afa70a997b5d15"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy