diff --git a/packages/esm-shim/src/constants.ts b/packages/esm-shim/src/constants.ts index 5ddd01ca6..ef2953f5e 100644 --- a/packages/esm-shim/src/constants.ts +++ b/packages/esm-shim/src/constants.ts @@ -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); diff --git a/packages/esm-shim/test/snapshots/test.js.md b/packages/esm-shim/test/snapshots/test.js.md index e0176a0cb..1447dcc3a 100644 --- a/packages/esm-shim/test/snapshots/test.js.md +++ b/packages/esm-shim/test/snapshots/test.js.md @@ -10,9 +10,9 @@ Generated by [AVA](https://avajs.dev). `␊ // -- 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);␊ @@ -27,9 +27,9 @@ Generated by [AVA](https://avajs.dev). `␊ // -- 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);␊ @@ -58,9 +58,9 @@ Generated by [AVA](https://avajs.dev). ␊ ␊ // -- 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);␊ @@ -80,9 +80,9 @@ Generated by [AVA](https://avajs.dev). ␊ ␊ // -- 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);␊ diff --git a/packages/esm-shim/test/snapshots/test.js.snap b/packages/esm-shim/test/snapshots/test.js.snap index 5143ca0dc..7c8a3ca3d 100644 Binary files a/packages/esm-shim/test/snapshots/test.js.snap and b/packages/esm-shim/test/snapshots/test.js.snap differ