@babel/preset-stage-2
Babel preset for stage 2 plugins
Last updated 10 months ago by nicolo-ribaudo .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @babel/preset-stage-2 
SYNC missed versions from official npm registry.

@babel/preset-stage-2

As of v7.0.0-beta.55, we've removed Babel's Stage presets. Please consider reading our blog post on this decision for more details. TL;DR is that it's more beneficial in the long run to explicitly add which proposals to use.


For a more automatic migration, we have updated babel-upgrade to do this for you (you can run npx babel-upgrade).

If you want the same configuration as before:

{
  "plugins": [
    // Stage 2
    ["@babel/plugin-proposal-decorators", { "legacy": true }],
    "@babel/plugin-proposal-function-sent",
    "@babel/plugin-proposal-export-namespace-from",
    "@babel/plugin-proposal-numeric-separator",
    "@babel/plugin-proposal-throw-expressions",

    // Stage 3
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-syntax-import-meta",
    ["@babel/plugin-proposal-class-properties", { "loose": true }],
    "@babel/plugin-proposal-json-strings"
  ]
}

If you're using the same configuration across many separate projects, keep in mind that you can also create your own custom presets with whichever plugins and presets you're looking to use.

module.exports = function() {
  return {
    plugins: [
      require("@babel/plugin-syntax-dynamic-import"),
      [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
      [require("@babel/plugin-proposal-class-properties"), { "loose": false }],
    ],
    presets: [
      // ...
    ],
  };
};

NOTE: Compatibility between @babel/plugin-proposal-class-properties and @babel/plugin-proposal-decorators If you are including your plugins manually and using @babel/plugin-proposal-class-properties, make sure that @babel/plugin-proposal-decorators comes before @babel/plugin-proposal-class-properties.

When using the legacy: true option of @babel/plugin-proposal-decorators, @babel/plugin-proposal-class-properties must be used in loose: true mode.

If you are not using @babel/plugin-proposal-decorators, loose mode is not needed.

Current Tags

  • 7.8.3                                ...           latest (10 months ago)

36 Versions

  • 7.8.3                                ...           10 months ago
  • 7.8.0                                ...           10 months ago
  • 7.0.0                                ...           2 years ago
  • 7.0.0-rc.4                                ...           2 years ago
  • 7.0.0-rc.3                                ...           2 years ago
  • 7.0.0-rc.2                                ...           2 years ago
  • 7.0.0-rc.1                                ...           2 years ago
  • 7.0.0-rc.0                                ...           2 years ago
  • 7.0.0-beta.56                                ...           2 years ago
  • 7.0.0-beta.55                                ...           2 years ago
  • 7.0.0-beta.54 [deprecated]           ...           2 years ago
  • 7.0.0-beta.53 [deprecated]           ...           2 years ago
  • 7.0.0-beta.52 [deprecated]           ...           2 years ago
  • 7.0.0-beta.51                                ...           2 years ago
  • 7.0.0-beta.50                                ...           2 years ago
  • 7.0.0-beta.49                                ...           3 years ago
  • 7.0.0-beta.48                                ...           3 years ago
  • 7.0.0-beta.47                                ...           3 years ago
  • 7.0.0-beta.46                                ...           3 years ago
  • 7.0.0-beta.45                                ...           3 years ago
  • 7.0.0-beta.44                                ...           3 years ago
  • 7.0.0-beta.43                                ...           3 years ago
  • 7.0.0-beta.42                                ...           3 years ago
  • 7.0.0-beta.41                                ...           3 years ago
  • 7.0.0-beta.40                                ...           3 years ago
  • 7.0.0-beta.39                                ...           3 years ago
  • 7.0.0-beta.38                                ...           3 years ago
  • 7.0.0-beta.37                                ...           3 years ago
  • 7.0.0-beta.36                                ...           3 years ago
  • 7.0.0-beta.35                                ...           3 years ago
  • 7.0.0-beta.34                                ...           3 years ago
  • 7.0.0-beta.33                                ...           3 years ago
  • 7.0.0-beta.32                                ...           3 years ago
  • 7.0.0-beta.31                                ...           3 years ago
  • 7.0.0-beta.5                                ...           3 years ago
  • 7.0.0-beta.4                                ...           3 years ago
Downloads
Today 237
This Week 746
This Month 4,121
Last Day 270
Last Week 1,161
Last Month 3,518
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (106)

Copyright 2014 - 2016 © taobao.org |