Skip to content

Commit

Permalink
fix(bin): allow global usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Oct 9, 2021
1 parent 1368d98 commit fbbb29f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/bin.ts
Expand Up @@ -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);
2 changes: 0 additions & 2 deletions test/config/index.ts
Expand Up @@ -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~!');

0 comments on commit fbbb29f

Please sign in to comment.