File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module' ;
2- import path from 'node:path' ;
3- import { fileURLToPath } from 'node:url' ;
1+ import path from 'path' ;
42import fg from 'fast-glob' ;
53import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin' ;
64import yargs from 'yargs' ;
75import { 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-
157const { argv } = yargs ( hideBin ( process . argv ) ) ;
168
179if ( argv instanceof Promise ) {
@@ -23,7 +15,7 @@ const getGlobPaths = (paths: string[]) =>
2315 paths . reduce < string [ ] > ( ( acc , path ) => [ ...acc , ...fg . sync ( path ) ] , [ ] ) ;
2416
2517function 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
2921function getStoryPaths ( fileName : string | number = '*' ) {
You can’t perform that action at this time.
0 commit comments