From 17e3affb7db4a5a599aa662a184e65bd964e41e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:00:19 +0000 Subject: [PATCH 1/6] Initial plan From beb90b4242f21574a5cad3f2367ffa74e7d7e681 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:09:28 +0000 Subject: [PATCH 2/6] feat: add import.meta handling for ESM modules - Remove import.meta from unsupported features list - Add function to detect import.meta usage in code - Implement replaceImportMetaObject to inject proper import.meta shims - Replace esbuild's empty import_meta object with implementation that provides: - import.meta.url (file URL) - import.meta.dirname (directory path) - import.meta.filename (file path) - Update test-50-esm-unsupported to verify import.meta support - Add new test-51-esm-import-meta to validate runtime behavior Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com> --- lib/esm-transformer.ts | 112 +++++++++++++++--- test/test-50-esm-unsupported/main.js | 44 ++++--- test/test-51-esm-import-meta/main.js | 87 ++++++++++++++ test/test-51-esm-import-meta/package.json | 4 + .../test-import-meta-basic.mjs | 34 ++++++ 5 files changed, 251 insertions(+), 30 deletions(-) create mode 100644 test/test-51-esm-import-meta/main.js create mode 100644 test/test-51-esm-import-meta/package.json create mode 100644 test/test-51-esm-import-meta/test-import-meta-basic.mjs diff --git a/lib/esm-transformer.ts b/lib/esm-transformer.ts index b1b522a2..a15a904c 100644 --- a/lib/esm-transformer.ts +++ b/lib/esm-transformer.ts @@ -16,11 +16,52 @@ interface UnsupportedFeature { column: number | null; } +/** + * Check if code contains import.meta usage + * + * @param code - The ESM source code to check + * @returns true if import.meta is used, false otherwise + */ +function hasImportMeta(code: string): boolean { + try { + const ast = babel.parse(code, { + sourceType: 'module', + plugins: [], + }); + + if (!ast) { + return false; + } + + let found = false; + + // @ts-expect-error Type mismatch due to @babel/types version in @types/babel__traverse + traverse(ast as t.File, { + // Detect import.meta usage + MetaProperty(path: NodePath) { + if ( + path.node.meta.name === 'import' && + path.node.property.name === 'meta' + ) { + found = true; + path.stop(); // Stop traversal once found + } + }, + }); + + return found; + } catch (error) { + // If we can't parse, assume no import.meta + return false; + } +} + /** * Detect ESM features that cannot be safely transformed to CommonJS * These include: * - Top-level await (no CJS equivalent) - * - import.meta (no CJS equivalent) + * + * Note: import.meta is now supported via polyfills and is no longer unsupported * * @param code - The ESM source code to check * @param filename - The filename for error reporting @@ -44,20 +85,6 @@ function detectUnsupportedESMFeatures( // @ts-expect-error Type mismatch due to @babel/types version in @types/babel__traverse traverse(ast as t.File, { - // Detect import.meta usage - MetaProperty(path: NodePath) { - if ( - path.node.meta.name === 'import' && - path.node.property.name === 'meta' - ) { - unsupportedFeatures.push({ - feature: 'import.meta', - line: path.node.loc?.start.line ?? null, - column: path.node.loc?.start.column ?? null, - }); - } - }, - // Detect top-level await AwaitExpression(path: NodePath) { // Check if await is at top level (not inside a function) @@ -130,6 +157,50 @@ function detectUnsupportedESMFeatures( } } +/** + * Replace esbuild's empty import_meta object with a proper implementation + * + * When esbuild transforms ESM to CJS, it converts `import.meta` to a `const import_meta = {}`. + * This function replaces that empty object with a proper implementation of import.meta properties. + * + * Shims provided: + * - import.meta.url: File URL of the current module + * - import.meta.dirname: Directory path of the current module (Node.js 20.11+) + * - import.meta.filename: File path of the current module (Node.js 20.11+) + * + * Based on approach from tsup and esbuild discussions + * @see https://github.com/egoist/tsup/blob/main/assets/cjs_shims.js + * @see https://github.com/evanw/esbuild/issues/3839 + * + * @param code - The transformed CJS code from esbuild + * @returns Code with import_meta properly implemented + */ +function replaceImportMetaObject(code: string): string { + // esbuild generates: const import_meta = {}; + // We need to replace this with a proper implementation + const shimImplementation = `const import_meta = { + get url() { + if (typeof document !== 'undefined') { + if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') { + return document.currentScript.src; + } + return new URL('main.js', document.baseURI).href; + } + return require('url').pathToFileURL(__filename).href; + }, + get dirname() { + return typeof __dirname !== 'undefined' ? __dirname : require('path').dirname(__filename); + }, + get filename() { + return typeof __filename !== 'undefined' ? __filename : ''; + } +};`; + + // Replace esbuild's empty import_meta object with our implementation + // Match: const import_meta = {}; + return code.replace(/const import_meta\s*=\s*\{\s*\};/, shimImplementation); +} + /** * Transform ESM code to CommonJS using esbuild * This allows ESM modules to be compiled to bytecode via vm.Script @@ -185,6 +256,9 @@ export function transformESMtoCJS( }; } + // Check if code uses import.meta before transformation + const usesImportMeta = hasImportMeta(code); + try { const result = esbuild.transformSync(code, { loader: 'js', @@ -203,8 +277,14 @@ export function transformESMtoCJS( }; } + // Inject import.meta shims after esbuild transformation if needed + let finalCode = result.code; + if (usesImportMeta) { + finalCode = replaceImportMetaObject(result.code); + } + return { - code: result.code, + code: finalCode, isTransformed: true, }; } catch (error) { diff --git a/test/test-50-esm-unsupported/main.js b/test/test-50-esm-unsupported/main.js index d0e70395..1859c777 100644 --- a/test/test-50-esm-unsupported/main.js +++ b/test/test-50-esm-unsupported/main.js @@ -4,6 +4,7 @@ const path = require('path'); const assert = require('assert'); +const { existsSync } = require('fs'); const utils = require('../utils.js'); assert(!module.parent); @@ -11,10 +12,10 @@ assert(__dirname === process.cwd()); const target = process.argv[2] || 'host'; -console.log('Testing unsupported ESM features detection...'); +console.log('Testing ESM features detection and transformation...'); -// Test 1: import.meta detection -console.log('\n=== Test 1: import.meta ==='); +// Test 1: import.meta support (should now work without warnings) +console.log('\n=== Test 1: import.meta support ==='); { const input = './test-import-meta.mjs'; const output = './run-time/test-import-meta.exe'; @@ -23,19 +24,25 @@ console.log('\n=== Test 1: import.meta ==='); const before = utils.filesBefore(newcomers); utils.mkdirp.sync(path.dirname(output)); - // Capture stdout to check for warnings + // Capture stdout to check that no warnings are emitted const result = utils.pkg.sync( ['--target', target, '--output', output, input], ['inherit', 'pipe', 'inherit'], ); - // Verify warning was emitted + // Verify NO warning was emitted (import.meta should now be supported) assert( - result.includes('import.meta') || - result.includes('Cannot transform ESM module'), - 'Should warn about import.meta usage', + !result.includes('import.meta') && + !result.includes('Cannot transform ESM module'), + 'Should NOT warn about import.meta usage (it is now supported)', + ); + + // Verify the executable was created + assert(existsSync(output), 'Executable should be created successfully'); + + console.log( + '✓ import.meta support working (no warnings, executable created)', ); - console.log('✓ import.meta detection working'); // Cleanup utils.filesAfter(before, newcomers); @@ -110,19 +117,26 @@ console.log('\n=== Test 4: multiple unsupported features ==='); ['inherit', 'pipe', 'inherit'], ); - // Verify multiple warnings were emitted + // Verify warnings were emitted only for truly unsupported features const hasImportMeta = result.includes('import.meta'); const hasTopLevelAwait = result.includes('top-level await'); const hasForAwaitOf = result.includes('for-await-of'); const hasGeneralWarning = result.includes('Cannot transform ESM module'); + // import.meta should NOT trigger a warning anymore (it's now supported) + assert( + !hasImportMeta, + 'Should NOT warn about import.meta (it is now supported)', + ); + + // But top-level await and for-await-of should still warn assert( - hasImportMeta || hasTopLevelAwait || hasForAwaitOf || hasGeneralWarning, - 'Should warn about multiple unsupported features', + hasTopLevelAwait || hasForAwaitOf || hasGeneralWarning, + 'Should warn about truly unsupported features (top-level await, for-await-of)', ); console.log('✓ Multiple features detection working'); - console.log(' - import.meta detected:', hasImportMeta); + console.log(' - import.meta detected:', hasImportMeta, '(should be false)'); console.log(' - top-level await detected:', hasTopLevelAwait); console.log(' - top-level for-await-of detected:', hasForAwaitOf); @@ -130,4 +144,6 @@ console.log('\n=== Test 4: multiple unsupported features ==='); utils.filesAfter(before, newcomers); } -console.log('\n✅ All unsupported ESM features correctly detected!'); +console.log( + '\n✅ All ESM features correctly handled! (import.meta now supported, top-level await/for-await-of still unsupported)', +); diff --git a/test/test-51-esm-import-meta/main.js b/test/test-51-esm-import-meta/main.js new file mode 100644 index 00000000..670df398 --- /dev/null +++ b/test/test-51-esm-import-meta/main.js @@ -0,0 +1,87 @@ +#!/usr/bin/env node + +'use strict'; + +const path = require('path'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); +const utils = require('../utils.js'); + +assert(!module.parent); +assert(__dirname === process.cwd()); + +const target = process.argv[2] || 'host'; + +console.log('Testing import.meta support in packaged executables...'); + +// Test: Package and run an ESM module that uses import.meta +console.log('\n=== Test: import.meta properties ==='); +{ + const input = './test-import-meta-basic.mjs'; + const output = './run-time/test-import-meta-basic.exe'; + const newcomers = ['run-time/test-import-meta-basic.exe']; + + const before = utils.filesBefore(newcomers); + utils.mkdirp.sync(path.dirname(output)); + + // Package the executable + const buildResult = utils.pkg.sync( + ['--target', target, '--output', output, input], + ['inherit', 'pipe', 'inherit'], + ); + + // Should NOT warn about import.meta + assert( + !buildResult.includes('import.meta') && + !buildResult.includes('Cannot transform ESM module'), + 'Should NOT warn about import.meta usage', + ); + + console.log('✓ Packaging succeeded without warnings'); + + // Run the executable and check output + const runResult = spawnSync(output, [], { + encoding: 'utf8', + timeout: 10000, + }); + + console.log('Executable output:'); + console.log(runResult.stdout); + + if (runResult.stderr) { + console.log('Executable stderr:'); + console.log(runResult.stderr); + } + + assert( + runResult.status === 0, + `Executable should exit with code 0, got ${runResult.status}`, + ); + + assert( + runResult.stdout.includes('import.meta.url works'), + 'Should show import.meta.url working', + ); + + assert( + runResult.stdout.includes('import.meta.dirname works'), + 'Should show import.meta.dirname working', + ); + + assert( + runResult.stdout.includes('import.meta.filename works'), + 'Should show import.meta.filename working', + ); + + assert( + runResult.stdout.includes('All import.meta properties work correctly'), + 'Should show success message', + ); + + console.log('✓ Executable runs correctly with import.meta support'); + + // Cleanup + utils.filesAfter(before, newcomers); +} + +console.log('\n✅ All import.meta tests passed!'); diff --git a/test/test-51-esm-import-meta/package.json b/test/test-51-esm-import-meta/package.json new file mode 100644 index 00000000..5e1ed9b4 --- /dev/null +++ b/test/test-51-esm-import-meta/package.json @@ -0,0 +1,4 @@ +{ + "name": "test-51-esm-import-meta", + "version": "1.0.0" +} diff --git a/test/test-51-esm-import-meta/test-import-meta-basic.mjs b/test/test-51-esm-import-meta/test-import-meta-basic.mjs new file mode 100644 index 00000000..d23ae202 --- /dev/null +++ b/test/test-51-esm-import-meta/test-import-meta-basic.mjs @@ -0,0 +1,34 @@ +// Test file to verify import.meta properties work correctly +console.log('Testing import.meta properties...'); + +// Test import.meta.url +if (!import.meta.url) { + console.error('FAIL: import.meta.url is not defined'); + process.exit(1); +} + +if (!import.meta.url.startsWith('file://')) { + console.error('FAIL: import.meta.url should start with file://'); + console.error('Got:', import.meta.url); + process.exit(1); +} + +console.log('✓ import.meta.url works:', import.meta.url); + +// Test import.meta.dirname +if (typeof import.meta.dirname === 'undefined') { + console.error('FAIL: import.meta.dirname is not defined'); + process.exit(1); +} + +console.log('✓ import.meta.dirname works:', import.meta.dirname); + +// Test import.meta.filename +if (typeof import.meta.filename === 'undefined') { + console.error('FAIL: import.meta.filename is not defined'); + process.exit(1); +} + +console.log('✓ import.meta.filename works:', import.meta.filename); + +console.log('\n✅ All import.meta properties work correctly!'); From 5207167089b78f1268a397f4611bfc83e8fa497d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:12:54 +0000 Subject: [PATCH 3/6] refactor: simplify import.meta polyfill implementation Remove unnecessary browser-specific code and defensive checks since pkg targets Node.js executables where __dirname and __filename are always available. Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com> --- lib/esm-transformer.ts | 11 +++-------- .../lib/community/time-y.node.bak | 1 + .../lib/enterprise/time-z.node.bak | 1 + test/test-50-native-addon-3/lib/time-x.node.bak | 1 + test/test-50-native-addon-4/lib/time.node.bak | 1 + test/test-50-native-addon/lib/time.node.bak | 1 + 6 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 test/test-50-native-addon-3/lib/community/time-y.node.bak create mode 100644 test/test-50-native-addon-3/lib/enterprise/time-z.node.bak create mode 100644 test/test-50-native-addon-3/lib/time-x.node.bak create mode 100644 test/test-50-native-addon-4/lib/time.node.bak create mode 100644 test/test-50-native-addon/lib/time.node.bak diff --git a/lib/esm-transformer.ts b/lib/esm-transformer.ts index a15a904c..52c941d0 100644 --- a/lib/esm-transformer.ts +++ b/lib/esm-transformer.ts @@ -178,21 +178,16 @@ function detectUnsupportedESMFeatures( function replaceImportMetaObject(code: string): string { // esbuild generates: const import_meta = {}; // We need to replace this with a proper implementation + // Note: We use getters to ensure values are computed at runtime in the correct context const shimImplementation = `const import_meta = { get url() { - if (typeof document !== 'undefined') { - if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') { - return document.currentScript.src; - } - return new URL('main.js', document.baseURI).href; - } return require('url').pathToFileURL(__filename).href; }, get dirname() { - return typeof __dirname !== 'undefined' ? __dirname : require('path').dirname(__filename); + return __dirname; }, get filename() { - return typeof __filename !== 'undefined' ? __filename : ''; + return __filename; } };`; diff --git a/test/test-50-native-addon-3/lib/community/time-y.node.bak b/test/test-50-native-addon-3/lib/community/time-y.node.bak new file mode 100644 index 00000000..7a4cb5f8 --- /dev/null +++ b/test/test-50-native-addon-3/lib/community/time-y.node.bak @@ -0,0 +1 @@ +module.exports = 'time-y'; diff --git a/test/test-50-native-addon-3/lib/enterprise/time-z.node.bak b/test/test-50-native-addon-3/lib/enterprise/time-z.node.bak new file mode 100644 index 00000000..1e395f40 --- /dev/null +++ b/test/test-50-native-addon-3/lib/enterprise/time-z.node.bak @@ -0,0 +1 @@ +module.exports = 'time-z'; diff --git a/test/test-50-native-addon-3/lib/time-x.node.bak b/test/test-50-native-addon-3/lib/time-x.node.bak new file mode 100644 index 00000000..37a46484 --- /dev/null +++ b/test/test-50-native-addon-3/lib/time-x.node.bak @@ -0,0 +1 @@ +module.exports = 'test'; diff --git a/test/test-50-native-addon-4/lib/time.node.bak b/test/test-50-native-addon-4/lib/time.node.bak new file mode 100644 index 00000000..37a46484 --- /dev/null +++ b/test/test-50-native-addon-4/lib/time.node.bak @@ -0,0 +1 @@ +module.exports = 'test'; diff --git a/test/test-50-native-addon/lib/time.node.bak b/test/test-50-native-addon/lib/time.node.bak new file mode 100644 index 00000000..37a46484 --- /dev/null +++ b/test/test-50-native-addon/lib/time.node.bak @@ -0,0 +1 @@ +module.exports = 'test'; From caa6093d09fa52cef183279e6e88a465e964a7f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:13:32 +0000 Subject: [PATCH 4/6] chore: remove accidentally committed test artifacts Remove .node.bak files that were inadvertently added in the previous commit Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com> --- test/test-50-native-addon-3/lib/community/time-y.node.bak | 1 - test/test-50-native-addon-3/lib/enterprise/time-z.node.bak | 1 - test/test-50-native-addon-3/lib/time-x.node.bak | 1 - test/test-50-native-addon-4/lib/time.node.bak | 1 - test/test-50-native-addon/lib/time.node.bak | 1 - 5 files changed, 5 deletions(-) delete mode 100644 test/test-50-native-addon-3/lib/community/time-y.node.bak delete mode 100644 test/test-50-native-addon-3/lib/enterprise/time-z.node.bak delete mode 100644 test/test-50-native-addon-3/lib/time-x.node.bak delete mode 100644 test/test-50-native-addon-4/lib/time.node.bak delete mode 100644 test/test-50-native-addon/lib/time.node.bak diff --git a/test/test-50-native-addon-3/lib/community/time-y.node.bak b/test/test-50-native-addon-3/lib/community/time-y.node.bak deleted file mode 100644 index 7a4cb5f8..00000000 --- a/test/test-50-native-addon-3/lib/community/time-y.node.bak +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'time-y'; diff --git a/test/test-50-native-addon-3/lib/enterprise/time-z.node.bak b/test/test-50-native-addon-3/lib/enterprise/time-z.node.bak deleted file mode 100644 index 1e395f40..00000000 --- a/test/test-50-native-addon-3/lib/enterprise/time-z.node.bak +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'time-z'; diff --git a/test/test-50-native-addon-3/lib/time-x.node.bak b/test/test-50-native-addon-3/lib/time-x.node.bak deleted file mode 100644 index 37a46484..00000000 --- a/test/test-50-native-addon-3/lib/time-x.node.bak +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'test'; diff --git a/test/test-50-native-addon-4/lib/time.node.bak b/test/test-50-native-addon-4/lib/time.node.bak deleted file mode 100644 index 37a46484..00000000 --- a/test/test-50-native-addon-4/lib/time.node.bak +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'test'; diff --git a/test/test-50-native-addon/lib/time.node.bak b/test/test-50-native-addon/lib/time.node.bak deleted file mode 100644 index 37a46484..00000000 --- a/test/test-50-native-addon/lib/time.node.bak +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'test'; From c739f78f6e1d067732dbb5e119311793b851a9f9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:13:54 +0000 Subject: [PATCH 5/6] fix: change test file from .mjs to .js to support Node.js 18 Node.js 18 doesn't support require() of .mjs files even if they are transformed to CJS. Changed test file extension to .js with "type": "module" in package.json, and renamed test runner to .cjs to avoid ESM conflicts. Added test file to .eslintignore since it contains ESM syntax. Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com> --- .eslintignore | 1 + test/test-51-esm-import-meta/{main.js => main.cjs} | 2 +- test/test-51-esm-import-meta/package.json | 3 ++- .../{test-import-meta-basic.mjs => test-import-meta-basic.js} | 0 4 files changed, 4 insertions(+), 2 deletions(-) rename test/test-51-esm-import-meta/{main.js => main.cjs} (97%) rename test/test-51-esm-import-meta/{test-import-meta-basic.mjs => test-import-meta-basic.js} (100%) diff --git a/.eslintignore b/.eslintignore index 9e901f17..49d7e3df 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ lib-es5 node_modules dist +test/test-51-esm-import-meta/test-import-meta-basic.js diff --git a/test/test-51-esm-import-meta/main.js b/test/test-51-esm-import-meta/main.cjs similarity index 97% rename from test/test-51-esm-import-meta/main.js rename to test/test-51-esm-import-meta/main.cjs index 670df398..5b767dfb 100644 --- a/test/test-51-esm-import-meta/main.js +++ b/test/test-51-esm-import-meta/main.cjs @@ -17,7 +17,7 @@ console.log('Testing import.meta support in packaged executables...'); // Test: Package and run an ESM module that uses import.meta console.log('\n=== Test: import.meta properties ==='); { - const input = './test-import-meta-basic.mjs'; + const input = './test-import-meta-basic.js'; const output = './run-time/test-import-meta-basic.exe'; const newcomers = ['run-time/test-import-meta-basic.exe']; diff --git a/test/test-51-esm-import-meta/package.json b/test/test-51-esm-import-meta/package.json index 5e1ed9b4..6ee7fea1 100644 --- a/test/test-51-esm-import-meta/package.json +++ b/test/test-51-esm-import-meta/package.json @@ -1,4 +1,5 @@ { "name": "test-51-esm-import-meta", - "version": "1.0.0" + "version": "1.0.0", + "type": "module" } diff --git a/test/test-51-esm-import-meta/test-import-meta-basic.mjs b/test/test-51-esm-import-meta/test-import-meta-basic.js similarity index 100% rename from test/test-51-esm-import-meta/test-import-meta-basic.mjs rename to test/test-51-esm-import-meta/test-import-meta-basic.js From 0717d8eddf6aa59da42dc4539b2da2315e15f93d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:15:32 +0000 Subject: [PATCH 6/6] refactor: move ESM test file to subdirectory Moved test-import-meta-basic.js to esm-module/ subdirectory with its own package.json to avoid conflicts with the test runner which expects main.js to be CommonJS. This allows the test to work with both the test runner and Node.js 18. Co-authored-by: robertsLando <11502495+robertsLando@users.noreply.github.com> --- .eslintignore | 2 +- test/test-51-esm-import-meta/{ => esm-module}/package.json | 0 .../{ => esm-module}/test-import-meta-basic.js | 0 test/test-51-esm-import-meta/{main.cjs => main.js} | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename test/test-51-esm-import-meta/{ => esm-module}/package.json (100%) rename test/test-51-esm-import-meta/{ => esm-module}/test-import-meta-basic.js (100%) rename test/test-51-esm-import-meta/{main.cjs => main.js} (97%) diff --git a/.eslintignore b/.eslintignore index 49d7e3df..f3f78c83 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,4 @@ lib-es5 node_modules dist -test/test-51-esm-import-meta/test-import-meta-basic.js +test/test-51-esm-import-meta/esm-module/test-import-meta-basic.js diff --git a/test/test-51-esm-import-meta/package.json b/test/test-51-esm-import-meta/esm-module/package.json similarity index 100% rename from test/test-51-esm-import-meta/package.json rename to test/test-51-esm-import-meta/esm-module/package.json diff --git a/test/test-51-esm-import-meta/test-import-meta-basic.js b/test/test-51-esm-import-meta/esm-module/test-import-meta-basic.js similarity index 100% rename from test/test-51-esm-import-meta/test-import-meta-basic.js rename to test/test-51-esm-import-meta/esm-module/test-import-meta-basic.js diff --git a/test/test-51-esm-import-meta/main.cjs b/test/test-51-esm-import-meta/main.js similarity index 97% rename from test/test-51-esm-import-meta/main.cjs rename to test/test-51-esm-import-meta/main.js index 5b767dfb..47fcf1f5 100644 --- a/test/test-51-esm-import-meta/main.cjs +++ b/test/test-51-esm-import-meta/main.js @@ -17,7 +17,7 @@ console.log('Testing import.meta support in packaged executables...'); // Test: Package and run an ESM module that uses import.meta console.log('\n=== Test: import.meta properties ==='); { - const input = './test-import-meta-basic.js'; + const input = './esm-module/test-import-meta-basic.js'; const output = './run-time/test-import-meta-basic.exe'; const newcomers = ['run-time/test-import-meta-basic.exe'];