Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/younho9/babel-preset
Sharable set of Babel plugins and config options
https://github.com/younho9/babel-preset
babel babel-preset
Last synced: about 3 hours ago
JSON representation
Sharable set of Babel plugins and config options
- Host: GitHub
- URL: https://github.com/younho9/babel-preset
- Owner: younho9
- License: mit
- Created: 2022-01-24T14:25:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-24T14:28:02.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T02:44:06.227Z (27 days ago)
- Topics: babel, babel-preset
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @younho9/babel-preset
> Sharable set of Babel plugins and config options
## Install
```sh
$ npm install --save-dev @younho9/babel-preset
```## Usage
Add `babel` key to your `package.json` or [babel configuration file](https://babeljs.io/docs/en/config-files#configuration-file-types). (ex. `babel.config.json`)
```json
{
// ...
"babel": {
"presets": [
[
"@younho9/babel-preset",
{
"development": false,
"isCJS": false,
"isESM": true,
"useTypescript": true,
"useReact": true,
"addModuleExports": false
}
]
]
}
// ...
}
```## Options
### `development`
`boolean`, defaults to `false`.
This toggles behavior specific to development for `@babel/preset-react`, such as adding `__source` and `__self`.
- https://babeljs.io/docs/en/babel-preset-react#development
### `isCJS`
`boolean`, defaults to `false`.
This is whether to use `commonjs` among `commonjs` or `false (esmodule)` module system options.
- https://babeljs.io/docs/en/babel-preset-env#modules
### `isESM`
`boolean`, defaults to `false`.
This toggles whether to target browsers that support `esmodule`.
- https://babeljs.io/docs/en/babel-preset-env#targetsesmodules
### `useTypescript`
`boolean`, defaults to `false`.
This toggles whether or not `@babel/preset-typescript` are used.
### `useReact`
`boolean`, defaults to `false`.
This toggles whether or not `@babel/preset-react` are used.
### `addModuleExports`
`boolean`, defaults to `false`.
This toggles whether or not `babel-plugin-add-module-exports` are used.
- https://www.npmjs.com/package/babel-plugin-add-module-exports
## License
[MIT](LICENSE)