1.0.2 • Published 3 years ago
@nlib/resolve-imports v1.0.2
@nlib/resolve-imports
A command line tool to disambiguates import statements.
Assume there's a.js
and b.js
:
// a.js
import {b} from './b';
console.info(b);
// b.js
export const b = 1;
This tool converts the import statement in the a.js
:
import {b} from './b';
// ↓
import {b} from './b.js';
Usage
npx @nlib/resolve-imports --directory path/to/dir
--include, -d [string] Specify patterns to include
--exclude [string] Specify patterns to exclude
--cjs Resolve the commonjs require() statements
--verbose Output more information for debugging
--help, -h Show help
--version, -v Output the version number