Skip to content

Commit

Permalink
Provide location of babel-loader from builder-webpack5
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Oct 18, 2022
1 parent 22c2f06 commit bf16c57
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
5 changes: 0 additions & 5 deletions code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,17 @@
"@babel/core": "^7.12.10",
"@storybook/mdx2-csf": "0.0.4-canary.14.04ffbe8.0",
"@types/util-deprecate": "^1.0.0",
"babel-loader": "^8.2.5",
"typescript": "~4.6.3"
},
"peerDependencies": {
"@storybook/mdx2-csf": "0.0.4-canary.14.04ffbe8.0",
"babel-loader": "^8.2.5",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"@storybook/mdx2-csf": {
"optional": true
},
"babel-loader": {
"optional": true
},
"react": {
"optional": true
},
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function webpack(
typeof createCompiler
>[0] */
) {
const resolvedBabelLoader = require.resolve('babel-loader');
const resolvedBabelLoader = await options.presets.apply('babelLoaderRef');

const { module = {} } = webpackConfig;

Expand Down
2 changes: 2 additions & 0 deletions code/lib/builder-webpack5/src/presets/preview-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ export const babel = async (config: any, options: any) => ({
},
],
});

export const babelLoaderRef = () => require.resolve('babel-loader');
4 changes: 0 additions & 4 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6478,7 +6478,6 @@ __metadata:
"@storybook/store": 7.0.0-alpha.38
"@storybook/theming": 7.0.0-alpha.38
"@types/util-deprecate": ^1.0.0
babel-loader: ^8.2.5
dequal: ^2.0.2
fs-extra: ^9.0.1
global: ^4.4.0
Expand All @@ -6490,14 +6489,11 @@ __metadata:
util-deprecate: ^1.0.2
peerDependencies:
"@storybook/mdx2-csf": 0.0.4-canary.14.04ffbe8.0
babel-loader: ^8.2.5
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
babel-loader:
optional: true
react:
optional: true
react-dom:
Expand Down

0 comments on commit bf16c57

Please sign in to comment.