Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix double esbuild-register register #19852

Merged
merged 4 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion code/addons/links/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const hrefTo = (title: ComponentTitle, name: StoryName): Promise<string>
});
};

// eslint-disable-next-line @typescript-eslint/no-shadow
const valueOrCall = (args: string[]) => (value: string | ((...args: string[]) => string)) =>
typeof value === 'function' ? value(...args) : value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-shadow */
import webpack from 'webpack';
import { logger } from '@storybook/node-logger';
import { BuilderContext, Target, targetFromTargetString } from '@angular-devkit/architect';
Expand Down
5 changes: 4 additions & 1 deletion code/lib/core-common/src/utils/interpret-require.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading