Update babel-preset-stage (0,1,2,3) readme files (#10111) [skip ci]

* chore: update docs babel-preset-stage readme [ci skip]

* fix:  by PR request change [ci skip]
This commit is contained in:
Lidor Avitan 2019-07-04 13:24:42 +03:00 committed by Nicolò Ribaudo
parent d50e78d45b
commit b06663320e
4 changed files with 33 additions and 5 deletions

View File

@ -32,7 +32,7 @@ If you want the same configuration as before:
// Stage 3 // Stage 3
"@babel/plugin-syntax-dynamic-import", "@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta", "@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }], ["@babel/plugin-proposal-class-properties", { "loose": true }],
"@babel/plugin-proposal-json-strings" "@babel/plugin-proposal-json-strings"
] ]
} }
@ -48,7 +48,7 @@ module.exports = function() {
plugins: [ plugins: [
require("@babel/plugin-syntax-dynamic-import"), require("@babel/plugin-syntax-dynamic-import"),
[require("@babel/plugin-proposal-decorators"), { "legacy": true }], [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
[require("@babel/plugin-proposal-class-properties"), { "loose": false }], [require("@babel/plugin-proposal-class-properties"), { "loose": true }],
], ],
presets: [ presets: [
// ... // ...
@ -56,3 +56,10 @@ module.exports = function() {
}; };
}; };
``` ```
**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.

View File

@ -29,7 +29,7 @@ If you want the same configuration as before:
// Stage 3 // Stage 3
"@babel/plugin-syntax-dynamic-import", "@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta", "@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }], ["@babel/plugin-proposal-class-properties", { "loose": true }],
"@babel/plugin-proposal-json-strings" "@babel/plugin-proposal-json-strings"
] ]
} }
@ -53,3 +53,10 @@ module.exports = function() {
}; };
}; };
``` ```
**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.

View File

@ -21,7 +21,7 @@ If you want the same configuration as before:
// Stage 3 // Stage 3
"@babel/plugin-syntax-dynamic-import", "@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta", "@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }], ["@babel/plugin-proposal-class-properties", { "loose": true }],
"@babel/plugin-proposal-json-strings" "@babel/plugin-proposal-json-strings"
] ]
} }
@ -45,3 +45,10 @@ module.exports = function() {
}; };
}; };
``` ```
**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.

View File

@ -29,7 +29,7 @@ module.exports = function() {
plugins: [ plugins: [
require("@babel/plugin-syntax-dynamic-import"), require("@babel/plugin-syntax-dynamic-import"),
[require("@babel/plugin-proposal-decorators"), { "legacy": true }], [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
[require("@babel/plugin-proposal-class-properties"), { "loose": false }], [require("@babel/plugin-proposal-class-properties"), { "loose": true }],
], ],
presets: [ presets: [
// ... // ...
@ -37,3 +37,10 @@ module.exports = function() {
}; };
}; };
``` ```
**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.