Skip to content

Commit

Permalink
fix(esm-shim): use 'node:' prefix for build in module imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeterush authored Nov 4, 2023
1 parent 23c5ca7 commit eed1790
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/esm-shim/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ export const CJSyntaxRegex = /__filename|__dirname|require\(|require\.resolve\(/

export const ESMShim = `
// -- Shims --
import cjsUrl from 'url';
import cjsPath from 'path';
import cjsModule from 'module';
import cjsUrl from 'node:url';
import cjsPath from 'node:path';
import cjsModule from 'node:module';
const __filename = cjsUrl.fileURLToPath(import.meta.url);
const __dirname = cjsPath.dirname(__filename);
const require = cjsModule.createRequire(import.meta.url);
Expand Down

0 comments on commit eed1790

Please sign in to comment.