Skip to content

Commit

Permalink
feat: add resolveFullExtension to cli (#219)
Browse files Browse the repository at this point in the history
* feat: add resolveFullExtension to cli

* fix: passed incorrect property
  • Loading branch information
epicmau5time authored May 12, 2024
1 parent 54a5459 commit abe4d6e
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit abe4d6e

Please sign in to comment.