File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ Outputs the Node.js compact build of `input.js` into `dist/index.js`.
7070 --v8-cache Emit a build using the v8 compile cache
7171 --license [file] Adds a file containing licensing information to the output
7272 --stats-out [file] Emit webpack stats as json to the specified output file
73- --target [es] ECMAScript target to use for output (default: es2015)
73+ --target [es] ECMAScript or Node.js target to use for output (default: es2015)
7474 Learn more: https://webpack.js.org/configuration/target
7575 -d, --debug Show debug logs
7676```
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ Options:
3838 --v8-cache Emit a build using the v8 compile cache
3939 --license [file] Adds a file containing licensing information to the output
4040 --stats-out [file] Emit webpack stats as json to the specified output file
41- --target [es] ECMAScript target to use for output (default: es2015)
41+ --target [es] ECMAScript or Node.js target to use for output (default: es2015)
4242 Learn more: https://webpack.js.org/configuration/target
4343 -d, --debug Show debug logs
4444` ;
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ function ncc (
8686 console . log ( `ncc: Compiling file ${ filename } into ${ esm ? 'ESM' : 'CJS' } ` ) ;
8787 }
8888
89- if ( target && ! target . startsWith ( 'es' ) ) {
90- throw new Error ( `Invalid "target" value provided ${ target } , value must be es version e.g. es2015` )
89+ if ( target && ( ! target . startsWith ( 'es' ) || ! target . startsWith ( 'node' ) ) ) {
90+ throw new Error ( `Invalid "target" value provided ${ target } , value must be "esX" or "node[[X].Y]" e.g. es2015 or node20 ` )
9191 }
9292
9393 const resolvedEntry = resolve . sync ( entry ) ;
You can’t perform that action at this time.
0 commit comments