@parcel/transformer-babel
This Parcel transformer plugin is responsible for transforming assets with Babel. It uses `@babel/core` to resolve babel config the same way Babel does and uses that if found. If no filesystem config is found it uses a default config that supports the mos
Last updated 6 months ago by devongovett .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @parcel/transformer-babel 
SYNC missed versions from official npm registry.

@parcel/transformer-babel

This Parcel transformer plugin is responsible for transforming assets with Babel. It uses @babel/core to resolve babel config the same way Babel does and uses that if found. If no filesystem config is found it uses a default config that supports the most common cases.

Default config

  • @babel/preset-env - Uses the targets defined in package.json or a default set of targets if none are defined to pass to @babel/preset-env as options. It runs over all source code as well as installed packages that have a browserslist with higher targets than the app being built by Parcel.
  • @babel/plugin-flow-strip-types - Right now it configures the flow plugin which uses the ast to check if there is a flow directive and strips types if so [TODO: It should do a cheap check of the code and only apply the plugin if a flow directive is found as it may affect parsing when it shouldn't]
  • @babel/plugin-transform-typescript - Configured for files with extenions .ts and .tsx
  • @babel/plugin-transform-react-jsx - Configured if file has extension .jsx or if a React like dependency is found as a dependency in package.json.

Custom config perf warnings

Parcel now supports all configuration formats that Babel supports, but some of them come with negative performance impacts.

  • babel.config.js/.babelrc.js - Since Babel 7, config files as JS are now supported. While this provides flexibility it hurts cacheability. Parcel cannot cache using the contents of the these files because the config they return is non deterministic based on content alone. Imported dependencies may change or the results may be based on environment variables. For this reason Parcel has to resolve load these files on each build and make sure their output is still the same. Another downside to using JS config files is that they end up being require()ed by Babel so Parcel cannot rebuild when the file changes in watch mode. To avoid these performance penalties, it is suggested that you use a babel.config.json or .babelrc file instead.
  • require('@babel') - With the advent of JS config files, it is now possible to directly require presets and plugins in configs instead of using names or paths that are resolved by Babel. Unfortunately this gives Parcel no information about which plugins/presets were used in a transformation so Parcel will be forced to run the Babel transformations on every build. It is suggested to avoid this type of configuration.

Current Tags

  • 2.0.0-alpha.3                                ...           latest (6 months ago)
  • 2.0.0-alpha.3.1                                ...           next (6 months ago)
  • 2.0.0-nightly.278                                ...           nightly (19 hours ago)
  • 2.0.0-alpha.1.1                                ...           v2 (9 months ago)

95 Versions

  • 2.0.0-nightly.278                                ...           19 hours ago
  • 2.0.0-nightly.277                                ...           7 days ago
  • 2.0.0-nightly.275                                ...           9 days ago
  • 2.0.0-nightly.272                                ...           15 days ago
  • 2.0.0-nightly.268                                ...           16 days ago
  • 2.0.0-nightly.266                                ...           17 days ago
  • 2.0.0-nightly.263                                ...           18 days ago
  • 2.0.0-nightly.261                                ...           19 days ago
  • 2.0.0-nightly.258                                ...           20 days ago
  • 2.0.0-nightly.257                                ...           21 days ago
  • 2.0.0-nightly.253                                ...           22 days ago
  • 2.0.0-nightly.252                                ...           23 days ago
  • 2.0.0-nightly.250                                ...           a month ago
  • 2.0.0-nightly.249                                ...           a month ago
  • 2.0.0-nightly.242                                ...           a month ago
  • 2.0.0-nightly.239                                ...           a month ago
  • 2.0.0-nightly.236                                ...           a month ago
  • 2.0.0-nightly.232                                ...           a month ago
  • 2.0.0-nightly.230                                ...           a month ago
  • 2.0.0-nightly.229                                ...           a month ago
  • 2.0.0-nightly.228                                ...           a month ago
  • 2.0.0-nightly.227                                ...           a month ago
  • 2.0.0-nightly.225                                ...           a month ago
  • 2.0.0-nightly.223                                ...           a month ago
  • 2.0.0-nightly.222                                ...           a month ago
  • 2.0.0-nightly.219                                ...           a month ago
  • 2.0.0-nightly.214                                ...           2 months ago
  • 2.0.0-nightly.210                                ...           2 months ago
  • 2.0.0-nightly.209                                ...           2 months ago
  • 2.0.0-nightly.207                                ...           2 months ago
  • 2.0.0-nightly.205                                ...           2 months ago
  • 2.0.0-nightly.203                                ...           2 months ago
  • 2.0.0-nightly.201                                ...           2 months ago
  • 2.0.0-nightly.200                                ...           2 months ago
  • 2.0.0-nightly.198                                ...           2 months ago
  • 2.0.0-nightly.196                                ...           2 months ago
  • 2.0.0-nightly.195                                ...           2 months ago
  • 2.0.0-nightly.191                                ...           2 months ago
  • 2.0.0-nightly.187                                ...           2 months ago
  • 2.0.0-nightly.186                                ...           2 months ago
  • 2.0.0-nightly.185                                ...           2 months ago
  • 2.0.0-nightly.182                                ...           2 months ago
  • 2.0.0-nightly.177                                ...           2 months ago
  • 2.0.0-nightly.173                                ...           2 months ago
  • 2.0.0-nightly.167                                ...           2 months ago
  • 2.0.0-nightly.166                                ...           2 months ago
  • 2.0.0-nightly.165                                ...           2 months ago
  • 2.0.0-nightly.159                                ...           2 months ago
  • 2.0.0-nightly.156                                ...           2 months ago
  • 2.0.0-nightly.155                                ...           2 months ago
  • 2.0.0-nightly.151                                ...           2 months ago
  • 2.0.0-nightly.150                                ...           2 months ago
  • 2.0.0-nightly.149                                ...           2 months ago
  • 2.0.0-nightly.148                                ...           3 months ago
  • 2.0.0-nightly.146                                ...           3 months ago
  • 2.0.0-nightly.144                                ...           3 months ago
  • 2.0.0-nightly.143                                ...           3 months ago
  • 2.0.0-nightly.142                                ...           3 months ago
  • 2.0.0-nightly.140                                ...           3 months ago
  • 2.0.0-nightly.137                                ...           3 months ago
  • 2.0.0-nightly.135                                ...           3 months ago
  • 2.0.0-nightly.133                                ...           3 months ago
  • 2.0.0-nightly.132                                ...           3 months ago
  • 2.0.0-nightly.130                                ...           3 months ago
  • 2.0.0-nightly.127                                ...           3 months ago
  • 2.0.0-nightly.122                                ...           3 months ago
  • 2.0.0-nightly.121                                ...           3 months ago
  • 2.0.0-nightly.120                                ...           3 months ago
  • 2.0.0-nightly.119                                ...           3 months ago
  • 2.0.0-nightly.118                                ...           3 months ago
  • 2.0.0-nightly.117                                ...           3 months ago
  • 2.0.0-nightly.116                                ...           3 months ago
  • 2.0.0-nightly.115                                ...           3 months ago
  • 2.0.0-nightly.112                                ...           3 months ago
  • 2.0.0-nightly.107                                ...           3 months ago
  • 2.0.0-nightly.102                                ...           4 months ago
  • 2.0.0-nightly.101                                ...           4 months ago
  • 2.0.0-nightly.97                                ...           4 months ago
  • 2.0.0-nightly.92                                ...           4 months ago
  • 2.0.0-nightly.88                                ...           4 months ago
  • 2.0.0-nightly.87                                ...           4 months ago
  • 2.0.0-nightly.85                                ...           4 months ago
  • 2.0.0-nightly.79                                ...           4 months ago
  • 2.0.0-nightly.72                                ...           4 months ago
  • 2.0.0-nightly.69                                ...           4 months ago
  • 2.0.0-nightly.68                                ...           4 months ago
  • 2.0.0-nightly.67                                ...           4 months ago
  • 2.0.0-nightly.66                                ...           4 months ago
  • 2.0.0-nightly.65                                ...           4 months ago
  • 2.0.0-alpha.3.1                                ...           6 months ago
  • 2.0.0-alpha.3                                ...           6 months ago
  • 2.0.0-alpha.2.1                                ...           7 months ago
  • 2.0.0-alpha.2                                ...           7 months ago
  • 2.0.0-alpha.1.1                                ...           9 months ago
  • 2.0.0-alpha.1                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 210
This Month 2,756
Last Day 96
Last Week 790
Last Month 3,177
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |