Skip to content

Commit

Permalink
fix: unify target arg description, add transpile-only arg to read…
Browse files Browse the repository at this point in the history
…me (#702)


Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
Simek and styfle committed May 3, 2021
1 parent 7310d25 commit 9066b2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion readme.md
Expand Up @@ -63,10 +63,12 @@ Outputs the Node.js compact build of `input.js` into `dist/index.js`.
-e, --external [mod] Skip bundling 'mod'. Can be used many times
-q, --quiet Disable build summaries / non-error outputs
-w, --watch Start a watched build
-t, --transpile-only Use transpileOnly option with the ts-loader
--v8-cache Emit a build using the v8 compile cache
--license [file] Adds a file containing licensing information to the output
--stats-out [file] Emit webpack stats as json to the specified output file
--target [es2015|es2020] Select ecmascript target to use for output
--target [es] ECMAScript target to use for output (default: es2015)
Learn more: https://webpack.js.org/configuration/target
```

### Execution Testing
Expand Down
5 changes: 3 additions & 2 deletions src/cli.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const { resolve, relative, dirname, sep, extname } = require("path");
const { resolve, relative, dirname, sep } = require("path");
const glob = require("glob");
const shebangRegEx = require("./utils/shebang");
const rimraf = require("rimraf");
Expand Down Expand Up @@ -35,7 +35,8 @@ Options:
--v8-cache Emit a build using the v8 compile cache
--license [file] Adds a file containing licensing information to the output
--stats-out [file] Emit webpack stats as json to the specified output file
--target What build target to use for webpack (default: es6)
--target [es] ECMAScript target to use for output (default: es2015)
Learn more: https://webpack.js.org/configuration/target
`;

// support an API mode for CLI testing
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -78,7 +78,7 @@ function ncc (
}

if (target && !target.startsWith('es')) {
throw new Error(`Invalid "target" value provided ${target}, value must be es version e.g. es5`)
throw new Error(`Invalid "target" value provided ${target}, value must be es version e.g. es2015`)
}

const resolvedEntry = resolve.sync(entry);
Expand Down

0 comments on commit 9066b2f

Please sign in to comment.