Skip to content

Commit

Permalink
fix: explicitly specify browsers list to avoid runtime errors
Browse files Browse the repository at this point in the history
  • Loading branch information
osdevisnot committed Jan 18, 2021
1 parent 4bcc45b commit dfcdd22
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ Then use `npm run` or `yarn` to invoke npm scripts as you normally would.

`klap` uses sensible defaults for most part. However, as needed, use below properties in `package.json` to fine tune `klap`. You can also use `cli flags` to control config options for `klap`.

| option | cli flag(s) | description | default |
| ---------------- | ---------------------- | ---------------------------------------------- | ------------------------------------------------- |
| `source` | -s --source | source file to compile and bundle | `src/index.js` |
| `cjs` | -c --cjs | the output file for common js format | pkg.main |
| `esm` | -e --esm | the output file for esm format | pkg.module |
| `umd` | -u --umd | the output file for umd format | pkg.browser |
| `types` | -t --types | the output file for type definitions | pkg.types |
| `browserslist` | -b --browserslist | browserslist compatible compilation target | `>1% and supports es6-module and last 2 versions` |
| `klap.name` | -n --name | package name for `umd` bundles | sanitized `pkg.name` |
| `klap.port` | -p --port | port for development server | `1234` |
| `klap.example` | --example | location of index js/ts file for start command | `public/index.js` or `pkg.source` |
| `klap.fallback` | --fallback | location of index html file for start command | `public/index.html` |
| `klap.target` | --target | target for development server (`umd, es`) | `es` |
| `klap.sourcemap` | --no-sourcemap | sourcemaps for builds | `true` |
| `klap.minify` | --no-minify | minification for builds | `true` |
| `klap.runtime` | --runtime | the runtime for new JSX transform | `react` |
| `klap.globals` | | global names for umd bundles | `{}` |
| option | cli flag(s) | description | default |
| ---------------- | ---------------------- | ---------------------------------------------- | ------------------------------------------------------------- |
| `source` | -s --source | source file to compile and bundle | `src/index.js` |
| `cjs` | -c --cjs | the output file for common js format | pkg.main |
| `esm` | -e --esm | the output file for esm format | pkg.module |
| `umd` | -u --umd | the output file for umd format | pkg.browser |
| `types` | -t --types | the output file for type definitions | pkg.types |
| `browserslist` | -b --browserslist | browserslist compatible compilation target | `last 2 versions modern browsers if usage is greater than 1%` |
| `klap.name` | -n --name | package name for `umd` bundles | sanitized `pkg.name` |
| `klap.port` | -p --port | port for development server | `1234` |
| `klap.example` | --example | location of index js/ts file for start command | `public/index.js` or `pkg.source` |
| `klap.fallback` | --fallback | location of index html file for start command | `public/index.html` |
| `klap.target` | --target | target for development server (`umd, es`) | `es` |
| `klap.sourcemap` | --no-sourcemap | sourcemaps for builds | `true` |
| `klap.minify` | --no-minify | minification for builds | `true` |
| `klap.runtime` | --runtime | the runtime for new JSX transform | `react` |
| `klap.globals` | | global names for umd bundles | `{}` |

## :clinking_glasses: License

Expand Down
2 changes: 1 addition & 1 deletion src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const getOptions = (pkg, command) => {
const {
klap = {},
source = 'src/index.js',
browserslist = '>1% and supports es6-module and last 2 versions',
browserslist = 'last 2 Chrome versions or last 2 ChromeAndroid versions or last 2 Safari versions or last 2 iOS versions or last 2 Firefox versions or last 2 FirefoxAndroid versions or last 2 Edge versions or last 2 Opera versions or last 2 OperaMobile versions or last 2 Samsung versions and >1%',
main,
module,
browser,
Expand Down

0 comments on commit dfcdd22

Please sign in to comment.