Skip to content

Commit

Permalink
fix: fix typo in browserslist
Browse files Browse the repository at this point in the history
  • Loading branch information
osdevisnot committed May 7, 2020
1 parent a5254df commit 6db9c9c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
36 changes: 18 additions & 18 deletions README.md
Expand Up @@ -89,24 +89,24 @@ 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` |
| | --main | the output file to write the cjs file to | pkg.main |
| | --module | the output file to write the esm file to | pkg.module |
| | --browser | the output file to write the umd file to | pkg.browser |
| `browserslist` | -b --browserlist | browserlist compatible compilation target | `>1%, not ie 11, not op_mini all` |
| `klap.name` | -n --name | package name for `umd` bundles | sanitized `pkg.name` |
| `klap.port` | -p --port | port for development server | `1234` |
| `klap.example` | -e --example | location of index js/ts file for start command | `public/index.js` or `pkg.source` |
| `klap.fallback` | -f --fallback | location of index html file for start command | `public/index.html` |
| `klap.target` | -t --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.globals` | | global names for umd bundles | `{}` |
| `klap.namedExports` | | named exports for commonjs modules | `{}` |

> Note: See default [browserlist coverage](https://browserl.ist/?q=%3E1%25%2C+not+ie+11%2C+not+op_mini+all)
| option | cli flag(s) | description | default |
| ------------------- | ---------------------- | ---------------------------------------------- | --------------------------------- |
| `source` | -s --source | source file to compile and bundle | `src/index.js` |
| | --main | the output file to write the cjs file to | pkg.main |
| | --module | the output file to write the esm file to | pkg.module |
| | --browser | the output file to write the umd file to | pkg.browser |
| `browserslist` | -b --browserslist | browserslist compatible compilation target | `>1%, not ie 11, not op_mini all` |
| `klap.name` | -n --name | package name for `umd` bundles | sanitized `pkg.name` |
| `klap.port` | -p --port | port for development server | `1234` |
| `klap.example` | -e --example | location of index js/ts file for start command | `public/index.js` or `pkg.source` |
| `klap.fallback` | -f --fallback | location of index html file for start command | `public/index.html` |
| `klap.target` | -t --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.globals` | | global names for umd bundles | `{}` |
| `klap.namedExports` | | named exports for commonjs modules | `{}` |

> Note: See default [browserslist coverage](https://browserl.ist/?q=%3E1%25%2C+not+ie+11%2C+not+op_mini+all)
## :clinking_glasses: License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -21,7 +21,7 @@
"presetup": "git clean -fdX",
"setup": "npm install",
"test": "echo 'run ./test.sh'",
"watch": "npm run build --watch"
"watch": "npm run build -- --watch"
},
"config": {
"commitizen": {
Expand Down
4 changes: 2 additions & 2 deletions src/babel.js
Expand Up @@ -24,7 +24,7 @@ let hasPackage = (pkg, name) =>

export const babelConfig = (command, pkg, options) => {
const extensions = [...DEFAULT_EXTENSIONS, '.ts', '.tsx', '.json'];
const { browserlist, format } = options;
const { browserslist, format } = options;

// Note: when using `React`, presetTs needs `React` as jsxPragma,
// vs presetReact needs `React.createElement`,
Expand All @@ -46,7 +46,7 @@ export const babelConfig = (command, pkg, options) => {
loose: true,
useBuiltIns: false,
modules: false,
targets: format === 'umd' ? browserlist + ', ie 11' : browserlist,
targets: format === 'umd' ? browserslist + ', ie 11' : browserslist,
exclude: ['transform-async-to-generator', 'transform-regenerator'],
include: ['transform-block-scoping'],
},
Expand Down
6 changes: 3 additions & 3 deletions src/options.js
Expand Up @@ -5,7 +5,7 @@ const getOptions = (pkg, command) => {
const {
klap = {},
source = 'src/index.js',
browserlist = '>1%, not ie 11, not op_mini all',
browserslist = '>1%, not ie 11, not op_mini all',
main,
module,
browser,
Expand All @@ -30,7 +30,7 @@ const getOptions = (pkg, command) => {
target: 't',
fallback: 'f',
example: 'e',
browserlist: 'b',
browserslist: 'b',
},
string: ['main', 'browser', 'module'],
default: {
Expand All @@ -42,7 +42,7 @@ const getOptions = (pkg, command) => {
minify,
fallback,
example,
browserlist,
browserslist,
},
});

Expand Down

0 comments on commit 6db9c9c

Please sign in to comment.