https://github.com/tidev/webpack-plugin-babel
Babel plugin for Appcd Webpack
https://github.com/tidev/webpack-plugin-babel
npm-package
Last synced: about 1 month ago
JSON representation
Babel plugin for Appcd Webpack
- Host: GitHub
- URL: https://github.com/tidev/webpack-plugin-babel
- Owner: tidev
- License: apache-2.0
- Created: 2020-05-08T12:01:36.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2024-03-06T21:44:46.000Z (over 1 year ago)
- Last Synced: 2025-04-23T23:41:50.083Z (2 months ago)
- Topics: npm-package
- Language: JavaScript
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 13
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @titanium-sdk/webpack-plugin-babel
> Babel plugin for Appcd Webpack
## Installation
To install this plugin in an existing project, run the following command in your project root:
```sh
npm i -D @titanium-sdk/webpack-plugin-babel
```## Configuration
When installing this plugin into an existing project, create a `babel.config.js` to configure babel. For Titanium apps the [`@titanium-sdk/babel-preset-app`](https://github.com/appcelerator/babel-preset-app) is recommended (and is already included in this plugin), but you can use any other Babel presets or plugins.
```js
module.exports = {
presets: [
'@titanium-sdk/app'
]
};
```New Titanium projects created with one of the Webpack project templates will already include this file.
> 💡 **TIP:** In case you want to use another preset, we highly recommend to include [babel-plugin-transform-titanium](https://github.com/appcelerator/babel-plugin-transform-titanium) to inline various static values, which help to strip away dead code.
## Webpack configuration
This plugin will add/modify the following Webpack options:
### Rules
- `rule('js')`
- `rule('js').use('cache-loader')`
- `rule('js').use('babel-loader')`