Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add resolveFullExtension to cli #219

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/bin/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env node
import { program } from 'commander';
import { Option, program } from 'commander';
import { replaceTscAliasPaths } from '..';

const { version } = require('../../package.json');
Expand All @@ -17,6 +17,14 @@ program
'-f, --resolve-full-paths',
'Attempt to fully resolve import paths if the corresponding .js file can be found'
)
.addOption(
new Option(
'-fe, --resolve-full-extension [ext]',
'Specify the extension of incomplete import paths, works with resolveFullPaths'
)
.choices(['.js', '.mjs', '.cjs'])
.default('.js')
)
.option(
'-s, --silent',
'Reduced terminal output (default: true) [deprecated]'
Expand All @@ -34,6 +42,7 @@ program
const options = program.opts();

replaceTscAliasPaths({
resolveFullExtension: options.resolveFullExtension,
configFile: options.project,
watch: !!options.watch,
outDir: options.dir,
Expand Down
Loading