mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 15:31:16 +08:00
fix double esbuild-register register
This commit is contained in:
parent
cd646a6786
commit
f0d350022c
@ -3,7 +3,10 @@ import { getInterpretedFileWithExt } from './interpret-files';
|
||||
let registered = false;
|
||||
|
||||
export function interopRequireDefault(filePath: string) {
|
||||
if (registered === false) {
|
||||
// eslint-disable-next-line no-underscore-dangle, global-require
|
||||
const hasEsbuildBeenRegistered = !!require('module')._extensions['.ts'];
|
||||
|
||||
if (registered === false && !hasEsbuildBeenRegistered) {
|
||||
// eslint-disable-next-line global-require
|
||||
const { register } = require('esbuild-register/dist/node');
|
||||
registered = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user