Skip to content

Commit

Permalink
fix: default build target (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecuvii authored Dec 2, 2023
1 parent 17121cc commit de7b1d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Then just run `npm run build`, or `pnpm build` / `yarn build` if you're using th
- Output (`-o <file>`): Specify output filename.
- Format (`-f <format>`): Set output format (default: `'esm'`).
- External (`--external <dep,>`): Specifying extra external dependencies, by default it is the list of `dependencies` and `peerDependencies` from `package.json`. Values are separate by comma.
- Target (`--target <target>`): Set ECMAScript target (default: `'es2016'`).
- Target (`--target <target>`): Set ECMAScript target (default: `'es2015'`).
- Runtime (`--runtime <runtime>`): Set build runtime (default: `'browser'`).
- Environment (`--env <env,>`): Define environment variables. (default: `NODE_ENV`, separate by comma)
- Working Directory (`--cwd <cwd>`): Set current working directory where containing `package.json`.
Expand Down Expand Up @@ -308,7 +308,7 @@ await bundle(path.resolve('./src/index.ts'), {
sourcemap: false, // Boolean
external: [], // string[]
format: 'esm', // 'esm' | 'cjs'
target: 'es2016', // ES syntax target
target: 'es2015', // ES syntax target
runtime: 'nodejs', // 'browser' | 'nodejs'
cwd: process.cwd(), // string
})
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Options:
-h, --help output usage information
--external <mod> specify an external dependency, separate by comma
--no-external do not bundle external dependencies
--target <target> js features target: swc target es versions. default: es2016
--target <target> js features target: swc target es versions. default: es2015
--runtime <runtime> build runtime (nodejs, browser). default: browser
--env <env> inlined process env variables, separate by comma. default: NODE_ENV
--cwd <cwd> specify current working directory
Expand Down
2 changes: 1 addition & 1 deletion test/typing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('types', () => {
sourcemap: false,
external: [],
format: 'esm',
target: 'es2016',
target: 'es2015',
runtime: 'nodejs',
}

Expand Down

0 comments on commit de7b1d7

Please sign in to comment.