Skip to content

Commit f0b8743

Browse files
committed
Revert "[core] Fix Storybook compatibility with Node.js 24 (#8040)"
This reverts commit 911e743.
1 parent 911e743 commit f0b8743

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

.storybook/main.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
import { createRequire } from 'node:module';
2-
import path from 'node:path';
3-
import { fileURLToPath } from 'node:url';
1+
import path from 'path';
42
import fg from 'fast-glob';
53
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
64
import yargs from 'yargs';
75
import { hideBin } from 'yargs/helpers';
86

9-
const currentModuleUrl = typeof import.meta !== 'undefined' ? import.meta.url : '';
10-
const __filename = fileURLToPath(currentModuleUrl);
11-
const __dirname = path.dirname(__filename);
12-
13-
const nodeRequire = createRequire(currentModuleUrl);
14-
157
const { argv } = yargs(hideBin(process.argv));
168

179
if (argv instanceof Promise) {
@@ -23,7 +15,7 @@ const getGlobPaths = (paths: string[]) =>
2315
paths.reduce<string[]>((acc, path) => [...acc, ...fg.sync(path)], []);
2416

2517
function getAbsolutePath(value: string) {
26-
return path.dirname(nodeRequire.resolve(path.join(value, 'package.json')));
18+
return path.dirname(require.resolve(path.join(value, 'package.json')));
2719
}
2820

2921
function getStoryPaths(fileName: string | number = '*') {

0 commit comments

Comments
 (0)