diff --git a/src/bin.ts b/src/bin.ts index df252d8..a30777d 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -27,6 +27,7 @@ if (argv.includes('-v') || argv.includes('--version')) { process.exit(0); } -require('child_process').spawn('node', ['--loader', 'tsm', ...argv], { +let file = require('path').join(__dirname, 'loader.mjs'); +require('child_process').spawn('node', ['--loader', file, ...argv], { stdio: 'inherit' }).on('exit', process.exit); diff --git a/test/config/index.ts b/test/config/index.ts index 25696b7..0e058d7 100644 --- a/test/config/index.ts +++ b/test/config/index.ts @@ -35,9 +35,7 @@ assert.equal(cjs.dashify('FooBar'), 'foo-bar', 'CJS :: value :: dashify'); // Checking ".js" with ESM content (type: module) assert.equal(typeof esm, 'object', 'ESM.js :: typeof'); -// @ts-ignore assert.equal(typeof esm.hello, 'function', 'ESM.js :: typeof :: hello'); -// @ts-ignore assert.equal(esm.hello('you'), 'hello, you', 'ESM.js :: value :: hello'); console.log('DONE~!');