1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = _default;
|
7 |
|
8 | function _default() {
|
9 | throw new Error(`
|
10 | As of v7.0.0-beta.55, we've removed Babel's Stage presets.
|
11 | Please consider reading our blog post on this decision at
|
12 | https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
|
13 | for more details. TL;DR is that it's more beneficial in the
|
14 | long run to explicitly add which proposals to use.
|
15 |
|
16 | For a more automatic migration, we have updated babel-upgrade,
|
17 | https://github.com/babel/babel-upgrade to do this for you with
|
18 | "npx babel-upgrade".
|
19 |
|
20 | If you want the same configuration as before:
|
21 |
|
22 | {
|
23 | "plugins": [
|
24 | // Stage 2
|
25 | ["@babel/plugin-proposal-decorators", { "legacy": true }],
|
26 | "@babel/plugin-proposal-function-sent",
|
27 | "@babel/plugin-proposal-export-namespace-from",
|
28 | "@babel/plugin-proposal-numeric-separator",
|
29 | "@babel/plugin-proposal-throw-expressions",
|
30 |
|
31 | // Stage 3
|
32 | "@babel/plugin-syntax-dynamic-import",
|
33 | "@babel/plugin-syntax-import-meta",
|
34 | ["@babel/plugin-proposal-class-properties", { "loose": false }],
|
35 | "@babel/plugin-proposal-json-strings"
|
36 | ]
|
37 | }
|
38 |
|
39 | If you're using the same configuration across many separate projects,
|
40 | keep in mind that you can also create your own custom presets with
|
41 | whichever plugins and presets you're looking to use.
|
42 |
|
43 | module.exports = function() {
|
44 | return {
|
45 | plugins: [
|
46 | require("@babel/plugin-syntax-dynamic-import"),
|
47 | [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
|
48 | [require("@babel/plugin-proposal-class-properties"), { "loose": false }],
|
49 | ],
|
50 | presets: [
|
51 | // ...
|
52 | ],
|
53 | };
|
54 | };
|
55 | `);
|
56 | } |
\ | No newline at end of file |