Skip to content

Commit 371bd5d

Browse files
committed
Update package.json and pnpm-lock.yaml to include @types/node@22 and adjust preset file paths for ESM compatibility. Enhance README with version compatibility details for Storybook.
1 parent 607cd73 commit 371bd5d

File tree

4 files changed

+49
-30
lines changed

4 files changed

+49
-30
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
# @storybook/addon-webpack5-compiler-babel
22

3-
This addon adds babel support to Storybook's webpack5 compiler. It adds the babel-loader to the webpack config and sets the `babel-loader` as the default loader for JavaScript and TypeScript files.
3+
This addon adds babel support to Storybook's webpack5 compiler. It adds the `babel-loader` to the webpack config and sets the `babel-loader` as the default loader for JavaScript and TypeScript files.
44

55
## Installation
66

77
```sh
88
npx storybook@latest add @storybook/addon-webpack5-compiler-babel
99
```
10+
11+
## Requirements
12+
13+
- Storybook@>=10.0.0
14+
15+
### Version compatibility
16+
17+
| Addon coverage version | Storybook version |
18+
| ---------------------- | ----------------- |
19+
| ^4.0.0 | ^10.0.0 |
20+
| ^3.0.0 | ^9.0.0 |
21+
| ^3.0.0 | ^8.0.0 |

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
"type": "module",
1717
"exports": {
1818
".": {
19-
"require": "./dist/index.cjs",
2019
"default": "./dist/index.js"
2120
},
22-
"./preset": "./dist/preset.cjs",
21+
"./preset": "./dist/preset.js",
2322
"./package.json": "./package.json"
2423
},
2524
"files": [
@@ -44,13 +43,17 @@
4443
},
4544
"devDependencies": {
4645
"@biomejs/biome": "^2.3.4",
46+
"@types/node": "^22",
4747
"auto": "^11.3.0",
4848
"find-cache-dir": "^5.0.0",
4949
"storybook": "^10.0.0",
5050
"tsup": "^8.5.0",
5151
"typescript": "^5.9.3",
5252
"webpack": "^5.97.1"
5353
},
54+
"peerDependencies": {
55+
"storybook": "^10.0.0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0"
56+
},
5457
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
5558
"publishConfig": {
5659
"access": "public"

pnpm-lock.yaml

Lines changed: 28 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/preset.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { Options } from "@storybook/types";
1+
import { fileURLToPath } from "node:url";
2+
import type { Options } from "storybook/internal/types";
23
import type { Configuration } from "webpack";
34
import { resolvePathInStorybookCache } from "./utils.js";
45

@@ -16,7 +17,7 @@ export const webpackFinal = async (config: Configuration, options: Options) => {
1617
test: typescriptOptions.skipCompiler ? /\.((c|m)?jsx?)$/ : /\.((c|m)?(j|t)sx?)$/,
1718
use: [
1819
{
19-
loader: require.resolve("babel-loader"),
20+
loader: fileURLToPath(import.meta.resolve("babel-loader")),
2021
options: {
2122
cacheDirectory: resolvePathInStorybookCache("babel"),
2223
...babelOptions,

0 commit comments

Comments
 (0)