2.12.0 • Published 2 days ago

@parcel/transformer-babel v2.12.0

Weekly downloads
23,009
License
MIT
Repository
github
Last release
2 days ago

@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.
2.0.0-dev.1557

3 days ago

2.0.0-dev.1574

3 days ago

2.0.0-dev.1573

3 days ago

2.0.0-dev.1572

4 days ago

2.0.0-dev.1565

9 days ago

2.0.0-dev.1431

17 days ago

2.0.0-dev.1430

17 days ago

2.0.0-dev.1429

17 days ago

2.0.0-dev.1427

18 days ago

2.0.0-dev.1426

21 days ago

2.0.0-dev.1425

21 days ago

2.0.0-dev.1424

22 days ago

2.0.0-dev.1548

1 month ago

2.0.0-canary.1526

2 months ago

2.0.0-dev.1528

1 month ago

2.0.0-canary.1524

2 months ago

2.0.0-canary.1523

2 months ago

2.0.0-canary.1521

2 months ago

2.0.0-canary.1522

2 months ago

2.0.0-dev.1516

2 months ago

2.0.0-dev.1518

2 months ago

2.0.0-dev.1517

2 months ago

2.0.0-nightly.1519

2 months ago

2.0.0-nightly.1518

2 months ago

2.0.0-nightly.1514

2 months ago

2.0.0-dev.1515

2 months ago

2.0.0-nightly.1504

2 months ago

2.0.0-nightly.1511

2 months ago

2.0.0-dev.1510

2 months ago

2.12.0

2 months ago

2.0.0-nightly.1503

2 months ago

2.0.0-nightly.1502

2 months ago

2.0.0-nightly.1501

2 months ago

2.0.0-nightly.1500

2 months ago

2.0.0-nightly.1498

3 months ago

2.0.0-nightly.1497

3 months ago

2.0.0-nightly.1496

3 months ago

2.0.0-nightly.1491

3 months ago

2.0.0-nightly.1490

3 months ago

2.0.0-nightly.1488

3 months ago

2.0.0-nightly.1486

3 months ago

2.0.0-nightly.1485

3 months ago

2.0.0-nightly.1484

4 months ago

2.0.0-nightly.1481

4 months ago

2.0.0-nightly.1482

4 months ago

2.0.0-nightly.1483

4 months ago

2.11.0

4 months ago

2.0.0-nightly.1471

4 months ago

2.0.0-nightly.1470

4 months ago

2.0.0-nightly.1468

4 months ago

2.0.0-nightly.1452

5 months ago

2.0.0-nightly.1451

5 months ago

2.0.0-nightly.1391

7 months ago

2.0.0-nightly.1395

7 months ago

2.10.1

6 months ago

2.10.2

6 months ago

2.10.0

7 months ago

2.0.0-nightly.1386

7 months ago

2.10.3

5 months ago

2.0.0-nightly.1399

7 months ago

2.0.0-nightly.1370

7 months ago

2.0.0-nightly.1373

7 months ago

2.0.0-nightly.1374

7 months ago

2.0.0-nightly.1365

8 months ago

2.0.0-nightly.1367

7 months ago

2.0.0-nightly.1368

7 months ago

2.0.0-nightly.1369

7 months ago

2.0.0-nightly.1380

7 months ago

2.0.0-nightly.1381

7 months ago

2.0.0-nightly.1385

7 months ago

2.0.0-nightly.1376

7 months ago

2.0.0-nightly.1350

9 months ago

2.0.0-nightly.1351

9 months ago

2.0.0-nightly.1352

9 months ago

2.0.0-nightly.1342

9 months ago

2.0.0-nightly.1344

9 months ago

2.0.0-nightly.1345

9 months ago

2.0.0-nightly.1349

9 months ago

2.0.0-nightly.1360

8 months ago

2.0.0-nightly.1362

8 months ago

2.0.0-nightly.1353

8 months ago

2.0.0-nightly.1354

8 months ago

2.0.0-nightly.1355

8 months ago

2.0.0-nightly.1356

8 months ago

2.0.0-nightly.1357

8 months ago

2.0.0-nightly.1358

8 months ago

2.0.0-nightly.1359

8 months ago

2.0.0-nightly.1449

5 months ago

2.0.0-nightly.1441

5 months ago

2.0.0-nightly.1442

5 months ago

2.0.0-nightly.1443

5 months ago

2.0.0-nightly.1445

5 months ago

2.0.0-nightly.1446

5 months ago

2.0.0-nightly.1447

5 months ago

2.0.0-nightly.1448

5 months ago

2.0.0-nightly.1340

9 months ago

2.0.0-nightly.1339

9 months ago

2.0.0-nightly.1427

6 months ago

2.0.0-nightly.1421

6 months ago

2.0.0-nightly.1423

6 months ago

2.0.0-nightly.1424

6 months ago

2.0.0-nightly.1439

5 months ago

2.0.0-nightly.1430

6 months ago

2.0.0-nightly.1431

6 months ago

2.0.0-nightly.1433

6 months ago

2.0.0-nightly.1434

5 months ago

2.0.0-nightly.1436

5 months ago

2.0.0-nightly.1405

7 months ago

2.0.0-nightly.1406

6 months ago

2.0.0-nightly.1400

7 months ago

2.0.0-nightly.1404

7 months ago

2.0.0-nightly.1417

6 months ago

2.0.0-nightly.1418

6 months ago

2.0.0-nightly.1419

6 months ago

2.0.0-nightly.1411

6 months ago

2.0.0-nightly.1415

6 months ago

2.9.3

10 months ago

2.0.0-nightly.1332

10 months ago

2.0.0-nightly.1335

10 months ago

2.0.0-nightly.1293

12 months ago

2.0.0-nightly.1294

12 months ago

2.0.0-nightly.1295

12 months ago

2.0.0-nightly.1298

12 months ago

2.0.0-nightly.1322

11 months ago

2.0.0-nightly.1324

11 months ago

2.0.0-nightly.1326

11 months ago

2.9.2

11 months ago

2.9.1

11 months ago

2.0.0-nightly.1331

11 months ago

2.0.0-nightly.1303

12 months ago

2.0.0-nightly.1319

11 months ago

2.0.0-nightly.1314

11 months ago

2.0.0-nightly.1316

11 months ago

2.8.4-nightly.0

12 months ago

2.9.0

11 months ago

2.0.0-nightly.1290

12 months ago

2.0.0-nightly.1289

12 months ago

2.8.1

1 year ago

2.8.3

1 year ago

2.8.2

1 year ago

2.8.0

1 year ago

2.7.0

2 years ago

2.6.1

2 years ago

2.6.2

2 years ago

2.6.0

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.5.0

2 years ago

2.3.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

2.0.0-rc.0

3 years ago

2.0.0-beta.3

3 years ago

2.0.0-beta.3.1

3 years ago

2.0.0-beta.2

3 years ago

2.0.0-beta.1

4 years ago

2.0.0-nightly.97

4 years ago

2.0.0-nightly.92

4 years ago

2.0.0-nightly.88

4 years ago

2.0.0-nightly.87

4 years ago

2.0.0-nightly.85

4 years ago

2.0.0-nightly.79

4 years ago

2.0.0-nightly.72

4 years ago

2.0.0-nightly.69

4 years ago

2.0.0-nightly.68

4 years ago

2.0.0-nightly.67

4 years ago

2.0.0-nightly.66

4 years ago

2.0.0-nightly.65

4 years ago

2.0.0-alpha.3.1

4 years ago

2.0.0-alpha.3

4 years ago

2.0.0-alpha.2.1

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1.1

5 years ago

2.0.0-alpha.1

5 years ago