From bd32d93bd965cc583da772f8c20e4947481a9230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 20 Jan 2020 19:49:18 +0100 Subject: [PATCH] Cleanup 7.8.0 versioned_docs (#2160) * Backport misc changes from #2150 * Remove 7.8.0 versioned_docs without updates --- docs/plugin-transform-dotall-regex.md | 2 +- .../plugin-check-es2015-constants.md | 4 +- .../version-6.26.3/plugin-external-helpers.md | 4 +- .../version-6.26.3/plugin-minify-builtins.md | 4 +- .../plugin-minify-constant-folding.md | 4 +- .../plugin-minify-dead-code-elimination.md | 4 +- .../plugin-minify-flip-comparisons.md | 4 +- .../plugin-minify-guarded-expressions.md | 4 +- .../version-6.26.3/plugin-minify-infinity.md | 4 +- .../plugin-minify-mangle-names.md | 4 +- .../plugin-minify-numeric-literals.md | 4 +- .../version-6.26.3/plugin-minify-replace.md | 4 +- .../version-6.26.3/plugin-minify-simplify.md | 4 +- .../plugin-minify-type-constructors.md | 4 +- .../plugin-syntax-async-functions.md | 4 +- .../plugin-syntax-async-generators.md | 4 +- .../plugin-syntax-class-constructor-call.md | 4 +- .../plugin-syntax-class-properties.md | 4 +- .../plugin-syntax-decorators.md | 4 +- .../plugin-syntax-do-expressions.md | 4 +- .../plugin-syntax-dynamic-import.md | 4 +- .../plugin-syntax-exponentiation-operator.md | 4 +- .../plugin-syntax-export-extensions.md | 4 +- .../version-6.26.3/plugin-syntax-flow.md | 4 +- .../plugin-syntax-function-bind.md | 4 +- .../plugin-syntax-function-sent.md | 4 +- .../version-6.26.3/plugin-syntax-jsx.md | 4 +- .../plugin-syntax-object-rest-spread.md | 4 +- .../plugin-syntax-trailing-function-commas.md | 4 +- .../plugin-transform-async-functions.md | 4 +- ...gin-transform-async-generator-functions.md | 4 +- .../plugin-transform-async-to-generator.md | 4 +- ...plugin-transform-async-to-module-method.md | 4 +- ...plugin-transform-class-constructor-call.md | 4 +- .../plugin-transform-class-properties.md | 4 +- .../plugin-transform-decorators.md | 4 +- .../plugin-transform-do-expressions.md | 4 +- ...plugin-transform-es2015-arrow-functions.md | 4 +- ...transform-es2015-block-scoped-functions.md | 4 +- .../plugin-transform-es2015-block-scoping.md | 4 +- .../plugin-transform-es2015-classes.md | 4 +- ...in-transform-es2015-computed-properties.md | 4 +- .../plugin-transform-es2015-destructuring.md | 4 +- .../plugin-transform-es2015-duplicate-keys.md | 4 +- .../plugin-transform-es2015-for-of.md | 4 +- .../plugin-transform-es2015-function-name.md | 4 +- .../plugin-transform-es2015-instanceof.md | 4 +- .../plugin-transform-es2015-literals.md | 4 +- .../plugin-transform-es2015-modules-amd.md | 4 +- ...lugin-transform-es2015-modules-commonjs.md | 4 +- ...lugin-transform-es2015-modules-systemjs.md | 4 +- .../plugin-transform-es2015-modules-umd.md | 4 +- .../plugin-transform-es2015-object-super.md | 4 +- .../plugin-transform-es2015-parameters.md | 4 +- ...n-transform-es2015-shorthand-properties.md | 4 +- .../plugin-transform-es2015-spread.md | 4 +- .../plugin-transform-es2015-sticky-regex.md | 4 +- ...ugin-transform-es2015-template-literals.md | 4 +- .../plugin-transform-es2015-typeof-symbol.md | 4 +- .../plugin-transform-es2015-unicode-regex.md | 4 +- ...ransform-es3-member-expression-literals.md | 4 +- .../plugin-transform-es3-property-literals.md | 4 +- .../plugin-transform-es5-property-mutators.md | 4 +- .../version-6.26.3/plugin-transform-eval.md | 4 +- ...lugin-transform-exponentiation-operator.md | 4 +- .../plugin-transform-export-extensions.md | 4 +- .../plugin-transform-flow-comments.md | 4 +- .../plugin-transform-flow-strip-types.md | 4 +- .../plugin-transform-function-bind.md | 4 +- ...lugin-transform-inline-consecutive-adds.md | 4 +- ...-transform-inline-environment-variables.md | 4 +- .../plugin-transform-jscript.md | 4 +- ...in-transform-member-expression-literals.md | 4 +- ...lugin-transform-merge-sibling-variables.md | 4 +- .../plugin-transform-minify-booleans.md | 4 +- .../plugin-transform-node-env-inline.md | 4 +- .../plugin-transform-object-assign.md | 4 +- .../plugin-transform-object-rest-spread.md | 4 +- ...sform-object-set-prototype-of-to-assign.md | 4 +- .../plugin-transform-property-literals.md | 4 +- .../plugin-transform-proto-to-assign.md | 4 +- ...lugin-transform-react-constant-elements.md | 4 +- .../plugin-transform-react-display-name.md | 4 +- .../plugin-transform-react-inline-elements.md | 4 +- .../plugin-transform-react-jsx-compat.md | 4 +- .../plugin-transform-react-jsx-self.md | 4 +- .../plugin-transform-react-jsx-source.md | 4 +- .../plugin-transform-react-jsx.md | 4 +- .../plugin-transform-regenerator.md | 2 +- .../plugin-transform-regexp-constructors.md | 4 +- .../plugin-transform-remove-console.md | 4 +- .../plugin-transform-remove-debugger.md | 4 +- .../plugin-transform-remove-undefined.md | 4 +- .../plugin-transform-runtime.md | 4 +- ...transform-simplify-comparison-operators.md | 4 +- .../plugin-transform-strict-mode.md | 4 +- .../plugin-transform-undefined-to-void.md | 4 +- .../plugin-undeclared-variables-check.md | 4 +- .../version-6.26.3/preset-es2015.md | 4 +- .../version-6.26.3/preset-es2016.md | 4 +- .../version-6.26.3/preset-es2017.md | 4 +- .../version-6.26.3/preset-flow.md | 4 +- .../version-6.26.3/preset-latest.md | 4 +- .../version-6.26.3/preset-minify.md | 4 +- .../version-6.26.3/preset-react.md | 4 +- .../version-6.26.3/preset-stage-0.md | 4 +- .../version-6.26.3/preset-stage-1.md | 4 +- .../version-6.26.3/preset-stage-2.md | 4 +- .../version-6.26.3/preset-stage-3.md | 4 +- .../version-7.0.0/plugin-external-helpers.md | 4 +- .../version-7.0.0/plugin-minify-builtins.md | 4 +- .../plugin-minify-constant-folding.md | 4 +- .../plugin-minify-dead-code-elimination.md | 4 +- .../plugin-minify-flip-comparisons.md | 4 +- .../plugin-minify-guarded-expressions.md | 4 +- .../version-7.0.0/plugin-minify-infinity.md | 4 +- .../plugin-minify-mangle-names.md | 4 +- .../plugin-minify-numeric-literals.md | 4 +- .../version-7.0.0/plugin-minify-replace.md | 4 +- .../version-7.0.0/plugin-minify-simplify.md | 4 +- .../plugin-minify-type-constructors.md | 4 +- ...ugin-proposal-async-generator-functions.md | 4 +- .../plugin-proposal-class-properties.md | 4 +- .../plugin-proposal-decorators.md | 2 +- .../plugin-proposal-do-expressions.md | 4 +- .../plugin-proposal-export-default-from.md | 4 +- .../plugin-proposal-export-namespace-from.md | 4 +- .../plugin-proposal-function-bind.md | 4 +- .../plugin-proposal-function-sent.md | 4 +- .../plugin-proposal-json-strings.md | 4 +- ...n-proposal-logical-assignment-operators.md | 4 +- ...in-proposal-nullish-coalescing-operator.md | 4 +- .../plugin-proposal-numeric-separator.md | 8 +- .../plugin-proposal-object-rest-spread.md | 4 +- .../plugin-proposal-optional-catch-binding.md | 4 +- .../plugin-proposal-optional-chaining.md | 4 +- .../plugin-proposal-pipeline-operator.md | 4 +- .../plugin-proposal-throw-expressions.md | 4 +- .../plugin-proposal-unicode-property-regex.md | 2 +- .../plugin-syntax-async-generators.md | 4 +- .../version-7.0.0/plugin-syntax-bigint.md | 4 +- .../plugin-syntax-class-properties.md | 4 +- .../version-7.0.0/plugin-syntax-decorators.md | 4 +- .../plugin-syntax-do-expressions.md | 4 +- .../plugin-syntax-dynamic-import.md | 4 +- .../plugin-syntax-export-default-from.md | 4 +- .../plugin-syntax-export-namespace-from.md | 4 +- .../version-7.0.0/plugin-syntax-flow.md | 4 +- .../plugin-syntax-function-bind.md | 4 +- .../plugin-syntax-function-sent.md | 4 +- .../plugin-syntax-import-meta.md | 4 +- .../plugin-syntax-json-strings.md | 4 +- .../version-7.0.0/plugin-syntax-jsx.md | 4 +- ...gin-syntax-logical-assignment-operators.md | 4 +- ...ugin-syntax-nullish-coalescing-operator.md | 4 +- .../plugin-syntax-numeric-separator.md | 4 +- .../plugin-syntax-object-rest-spread.md | 4 +- .../plugin-syntax-optional-catch-binding.md | 4 +- .../plugin-syntax-optional-chaining.md | 4 +- .../plugin-syntax-pipeline-operator.md | 4 +- .../plugin-syntax-throw-expressions.md | 4 +- .../version-7.0.0/plugin-syntax-typescript.md | 4 +- .../plugin-transform-arrow-functions.md | 4 +- .../plugin-transform-async-to-generator.md | 4 +- ...plugin-transform-block-scoped-functions.md | 4 +- .../plugin-transform-block-scoping.md | 4 +- .../version-7.0.0/plugin-transform-classes.md | 4 +- .../plugin-transform-computed-properties.md | 4 +- .../plugin-transform-destructuring.md | 4 +- .../plugin-transform-dotall-regex.md | 2 +- .../plugin-transform-duplicate-keys.md | 4 +- ...lugin-transform-exponentiation-operator.md | 4 +- .../plugin-transform-flow-comments.md | 4 +- .../plugin-transform-flow-strip-types.md | 4 +- .../version-7.0.0/plugin-transform-for-of.md | 4 +- .../plugin-transform-function-name.md | 4 +- ...lugin-transform-inline-consecutive-adds.md | 4 +- ...-transform-inline-environment-variables.md | 4 +- .../plugin-transform-instanceof.md | 4 +- .../version-7.0.0/plugin-transform-jscript.md | 4 +- .../plugin-transform-literals.md | 4 +- ...in-transform-member-expression-literals.md | 4 +- ...lugin-transform-merge-sibling-variables.md | 4 +- .../plugin-transform-minify-booleans.md | 4 +- .../plugin-transform-modules-amd.md | 4 +- .../plugin-transform-modules-commonjs.md | 4 +- .../plugin-transform-modules-systemjs.md | 4 +- .../plugin-transform-modules-umd.md | 4 +- .../plugin-transform-new-target.md | 4 +- .../plugin-transform-node-env-inline.md | 4 +- .../plugin-transform-object-assign.md | 4 +- ...sform-object-set-prototype-of-to-assign.md | 4 +- .../plugin-transform-object-super.md | 4 +- .../plugin-transform-parameters.md | 4 +- .../plugin-transform-property-literals.md | 4 +- .../plugin-transform-property-mutators.md | 4 +- .../plugin-transform-proto-to-assign.md | 4 +- ...lugin-transform-react-constant-elements.md | 4 +- .../plugin-transform-react-display-name.md | 4 +- .../plugin-transform-react-inline-elements.md | 4 +- .../plugin-transform-react-jsx-compat.md | 4 +- .../plugin-transform-react-jsx-self.md | 4 +- .../plugin-transform-react-jsx-source.md | 4 +- .../plugin-transform-react-jsx.md | 4 +- .../plugin-transform-regenerator.md | 2 +- .../plugin-transform-regexp-constructors.md | 4 +- .../plugin-transform-remove-console.md | 4 +- .../plugin-transform-remove-debugger.md | 4 +- .../plugin-transform-remove-undefined.md | 4 +- .../plugin-transform-reserved-words.md | 4 +- .../version-7.0.0/plugin-transform-runtime.md | 4 +- .../plugin-transform-shorthand-properties.md | 4 +- ...transform-simplify-comparison-operators.md | 4 +- .../version-7.0.0/plugin-transform-spread.md | 4 +- .../plugin-transform-sticky-regex.md | 4 +- .../plugin-transform-strict-mode.md | 4 +- .../plugin-transform-template-literals.md | 4 +- .../plugin-transform-typeof-symbol.md | 4 +- .../plugin-transform-typescript.md | 4 +- .../plugin-transform-undefined-to-void.md | 4 +- .../plugin-transform-unicode-regex.md | 4 +- .../version-7.0.0/preset-es2015.md | 4 +- .../version-7.0.0/preset-es2016.md | 4 +- .../version-7.0.0/preset-es2017.md | 4 +- .../version-7.0.0/preset-flow.md | 4 +- .../version-7.0.0/preset-minify.md | 4 +- .../version-7.0.0/preset-react.md | 4 +- .../version-7.0.0/preset-stage-0.md | 4 +- .../version-7.0.0/preset-stage-1.md | 4 +- .../version-7.0.0/preset-stage-2.md | 4 +- .../version-7.0.0/preset-stage-3.md | 4 +- .../version-7.0.0/preset-typescript.md | 4 +- .../plugin-proposal-decorators.md | 2 +- .../plugin-proposal-private-methods.md | 4 +- .../plugin-proposal-pipeline-operator.md | 4 +- .../plugin-proposal-private-methods.md | 4 +- ...-transform-named-capturing-groups-regex.md | 4 +- .../plugin-proposal-partial-application.md | 2 +- .../plugin-syntax-dynamic-import.md | 4 +- .../plugin-syntax-partial-application.md | 4 +- .../version-7.4.0/plugin-transform-runtime.md | 4 +- .../plugin-proposal-pipeline-operator.md | 4 +- .../plugin-transform-typescript.md | 4 +- .../version-7.6.0/preset-typescript.md | 4 +- .../plugin-syntax-top-level-await.md | 4 +- .../plugin-transform-react-jsx.md | 4 +- .../plugin-transform-typescript.md | 4 +- .../version-7.7.0/preset-react.md | 4 +- .../version-7.8.0/plugin-external-helpers.md | 35 --- .../plugin-minify-constant-folding.md | 93 -------- .../plugin-minify-dead-code-elimination.md | 77 ------- .../plugin-minify-flip-comparisons.md | 57 ----- .../plugin-minify-guarded-expressions.md | 51 ----- .../version-7.8.0/plugin-minify-infinity.md | 49 ---- .../plugin-minify-mangle-names.md | 82 ------- .../plugin-minify-numeric-literals.md | 51 ----- .../version-7.8.0/plugin-minify-replace.md | 93 -------- .../version-7.8.0/plugin-minify-simplify.md | 83 ------- .../plugin-minify-type-constructors.md | 70 ------ ...ugin-proposal-async-generator-functions.md | 109 --------- .../plugin-proposal-class-properties.md | 155 ------------- .../plugin-proposal-decorators.md | 149 ------------ .../plugin-proposal-export-default-from.md | 47 ---- .../plugin-proposal-export-namespace-from.md | 47 ---- .../plugin-proposal-function-bind.md | 123 ---------- .../plugin-proposal-function-sent.md | 68 ------ .../plugin-proposal-json-strings.md | 56 ----- ...n-proposal-logical-assignment-operators.md | 65 ------ ...in-proposal-nullish-coalescing-operator.md | 88 ------- .../plugin-proposal-numeric-separator.md | 113 --------- .../plugin-proposal-object-rest-spread.md | 109 --------- .../plugin-proposal-optional-catch-binding.md | 62 ----- .../plugin-proposal-pipeline-operator.md | 44 ---- .../plugin-proposal-private-methods.md | 142 ------------ .../plugin-proposal-throw-expressions.md | 49 ---- .../plugin-syntax-async-generators.md | 63 ----- .../version-7.8.0/plugin-syntax-bigint.md | 38 --- .../plugin-syntax-class-properties.md | 41 ---- .../version-7.8.0/plugin-syntax-decorators.md | 67 ------ .../plugin-syntax-do-expressions.md | 41 ---- .../plugin-syntax-dynamic-import.md | 88 ------- .../plugin-syntax-export-default-from.md | 41 ---- .../plugin-syntax-export-namespace-from.md | 41 ---- .../version-7.8.0/plugin-syntax-flow.md | 37 --- .../plugin-syntax-function-bind.md | 41 ---- .../plugin-syntax-function-sent.md | 41 ---- .../plugin-syntax-import-meta.md | 37 --- .../plugin-syntax-json-strings.md | 41 ---- .../version-7.8.0/plugin-syntax-jsx.md | 37 --- ...gin-syntax-logical-assignment-operators.md | 41 ---- ...ugin-syntax-nullish-coalescing-operator.md | 41 ---- .../plugin-syntax-numeric-separator.md | 41 ---- .../plugin-syntax-object-rest-spread.md | 41 ---- .../plugin-syntax-optional-catch-binding.md | 58 ----- .../plugin-syntax-optional-chaining.md | 41 ---- .../plugin-syntax-partial-application.md | 40 ---- .../plugin-syntax-pipeline-operator.md | 41 ---- .../plugin-syntax-throw-expressions.md | 48 ---- .../plugin-syntax-top-level-await.md | 48 ---- .../version-7.8.0/plugin-syntax-typescript.md | 44 ---- .../plugin-transform-arrow-functions.md | 152 ------------ .../plugin-transform-async-to-generator.md | 91 -------- ...plugin-transform-block-scoped-functions.md | 62 ----- .../plugin-transform-block-scoping.md | 106 --------- .../version-7.8.0/plugin-transform-classes.md | 148 ------------ .../plugin-transform-computed-properties.md | 133 ----------- .../plugin-transform-destructuring.md | 108 --------- .../plugin-transform-duplicate-keys.md | 62 ----- ...lugin-transform-exponentiation-operator.md | 60 ----- .../plugin-transform-flow-comments.md | 73 ------ .../plugin-transform-flow-strip-types.md | 83 ------- .../version-7.8.0/plugin-transform-for-of.md | 157 ------------- .../plugin-transform-function-name.md | 53 ----- ...lugin-transform-inline-consecutive-adds.md | 68 ------ ...-transform-inline-environment-variables.md | 70 ------ .../plugin-transform-instanceof.md | 64 ------ .../version-7.8.0/plugin-transform-jscript.md | 59 ----- .../plugin-transform-literals.md | 55 ----- ...in-transform-member-expression-literals.md | 57 ----- ...lugin-transform-merge-sibling-variables.md | 62 ----- .../plugin-transform-minify-booleans.md | 53 ----- .../plugin-transform-modules-amd.md | 63 ----- .../plugin-transform-modules-commonjs.md | 168 -------------- .../plugin-transform-modules-systemjs.md | 77 ------- .../plugin-transform-modules-umd.md | 216 ------------------ ...-transform-named-capturing-groups-regex.md | 77 ------- .../plugin-transform-new-target.md | 106 --------- .../plugin-transform-node-env-inline.md | 58 ----- .../plugin-transform-object-assign.md | 62 ----- ...sform-object-set-prototype-of-to-assign.md | 54 ----- .../plugin-transform-object-super.md | 75 ------ .../plugin-transform-parameters.md | 104 --------- .../plugin-transform-property-literals.md | 67 ------ .../plugin-transform-property-mutators.md | 69 ------ .../plugin-transform-proto-to-assign.md | 82 ------- ...lugin-transform-react-constant-elements.md | 109 --------- .../plugin-transform-react-display-name.md | 57 ----- .../plugin-transform-react-inline-elements.md | 84 ------- .../plugin-transform-react-jsx-compat.md | 57 ----- .../plugin-transform-react-jsx-self.md | 51 ----- .../plugin-transform-react-jsx-source.md | 51 ----- .../plugin-transform-react-jsx.md | 210 ----------------- .../plugin-transform-regenerator.md | 91 -------- .../plugin-transform-regexp-constructors.md | 53 ----- .../plugin-transform-remove-console.md | 64 ------ .../plugin-transform-remove-debugger.md | 50 ---- .../plugin-transform-remove-undefined.md | 66 ------ .../plugin-transform-reserved-words.md | 61 ----- .../plugin-transform-shorthand-properties.md | 71 ------ ...transform-simplify-comparison-operators.md | 51 ----- .../version-7.8.0/plugin-transform-spread.md | 86 ------- .../plugin-transform-sticky-regex.md | 51 ----- .../plugin-transform-strict-mode.md | 59 ----- .../plugin-transform-template-literals.md | 88 ------- .../plugin-transform-typeof-symbol.md | 55 ----- .../plugin-transform-undefined-to-void.md | 53 ----- .../plugin-transform-unicode-regex.md | 53 ----- .../version-7.8.0/preset-es2015.md | 63 ----- .../version-7.8.0/preset-es2016.md | 40 ---- .../version-7.8.0/preset-es2017.md | 40 ---- .../version-7.8.0/preset-flow.md | 79 ------- .../version-7.8.0/preset-minify.md | 169 -------------- .../version-7.8.0/preset-react.md | 146 ------------ .../version-7.8.0/preset-stage-0.md | 63 ----- .../version-7.8.0/preset-stage-1.md | 76 ------ .../version-7.8.0/preset-stage-2.md | 78 ------- .../version-7.8.0/preset-stage-3.md | 72 ------ 367 files changed, 249 insertions(+), 9487 deletions(-) delete mode 100644 website/versioned_docs/version-7.8.0/plugin-external-helpers.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-constant-folding.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-dead-code-elimination.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-flip-comparisons.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-guarded-expressions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-infinity.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-mangle-names.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-numeric-literals.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-replace.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-simplify.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-minify-type-constructors.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-async-generator-functions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-class-properties.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-decorators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-export-default-from.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-export-namespace-from.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-function-bind.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-function-sent.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-json-strings.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-logical-assignment-operators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-nullish-coalescing-operator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-numeric-separator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-object-rest-spread.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-optional-catch-binding.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-pipeline-operator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-private-methods.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-proposal-throw-expressions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-async-generators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-bigint.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-class-properties.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-decorators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-do-expressions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-dynamic-import.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-export-default-from.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-export-namespace-from.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-flow.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-function-bind.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-function-sent.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-import-meta.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-json-strings.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-jsx.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-logical-assignment-operators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-nullish-coalescing-operator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-numeric-separator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-object-rest-spread.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-optional-catch-binding.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-optional-chaining.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-partial-application.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-pipeline-operator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-throw-expressions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-top-level-await.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-syntax-typescript.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-arrow-functions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-async-to-generator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-block-scoped-functions.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-block-scoping.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-classes.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-computed-properties.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-destructuring.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-duplicate-keys.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-exponentiation-operator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-flow-comments.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-flow-strip-types.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-for-of.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-function-name.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-inline-consecutive-adds.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-inline-environment-variables.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-instanceof.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-jscript.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-literals.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-member-expression-literals.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-merge-sibling-variables.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-minify-booleans.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-modules-amd.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-modules-commonjs.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-modules-systemjs.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-modules-umd.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-named-capturing-groups-regex.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-new-target.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-node-env-inline.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-object-assign.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-object-set-prototype-of-to-assign.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-object-super.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-parameters.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-property-literals.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-property-mutators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-proto-to-assign.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-constant-elements.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-display-name.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-inline-elements.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-compat.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-self.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-source.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-react-jsx.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-regenerator.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-regexp-constructors.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-remove-console.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-remove-debugger.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-remove-undefined.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-reserved-words.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-shorthand-properties.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-simplify-comparison-operators.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-spread.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-sticky-regex.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-strict-mode.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-template-literals.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-typeof-symbol.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-undefined-to-void.md delete mode 100644 website/versioned_docs/version-7.8.0/plugin-transform-unicode-regex.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-es2015.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-es2016.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-es2017.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-flow.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-minify.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-react.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-stage-0.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-stage-1.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-stage-2.md delete mode 100644 website/versioned_docs/version-7.8.0/preset-stage-3.md diff --git a/docs/plugin-transform-dotall-regex.md b/docs/plugin-transform-dotall-regex.md index 85ef326c3e..83a9b670f6 100644 --- a/docs/plugin-transform-dotall-regex.md +++ b/docs/plugin-transform-dotall-regex.md @@ -40,7 +40,7 @@ npm install --save-dev @babel/plugin-transform-dotall-regex ## Usage -### Via `.babelrc` (recommended) +### With a configuration file (Recommended) `.babelrc` diff --git a/website/versioned_docs/version-6.26.3/plugin-check-es2015-constants.md b/website/versioned_docs/version-6.26.3/plugin-check-es2015-constants.md index 82bb189e9e..3d40281dbc 100644 --- a/website/versioned_docs/version-6.26.3/plugin-check-es2015-constants.md +++ b/website/versioned_docs/version-6.26.3/plugin-check-es2015-constants.md @@ -35,9 +35,7 @@ npm install --save-dev babel-plugin-check-es2015-constants ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-external-helpers.md b/website/versioned_docs/version-6.26.3/plugin-external-helpers.md index c9f7f5c139..241ee76c46 100644 --- a/website/versioned_docs/version-6.26.3/plugin-external-helpers.md +++ b/website/versioned_docs/version-6.26.3/plugin-external-helpers.md @@ -82,9 +82,7 @@ npm install --save-dev babel-plugin-external-helpers ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-builtins.md b/website/versioned_docs/version-6.26.3/plugin-minify-builtins.md index df7fef1a32..f9f0c894e7 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-builtins.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-builtins.md @@ -29,9 +29,7 @@ npm install babel-plugin-minify-builtins ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-constant-folding.md b/website/versioned_docs/version-6.26.3/plugin-minify-constant-folding.md index 2bab3af74b..3372b73615 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-constant-folding.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-constant-folding.md @@ -64,9 +64,7 @@ npm install babel-plugin-minify-constant-folding ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-dead-code-elimination.md b/website/versioned_docs/version-6.26.3/plugin-minify-dead-code-elimination.md index 17d3e2fdaa..5563b0f861 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-dead-code-elimination.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-dead-code-elimination.md @@ -39,9 +39,7 @@ npm install babel-plugin-minify-dead-code-elimination ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-flip-comparisons.md b/website/versioned_docs/version-6.26.3/plugin-minify-flip-comparisons.md index 931538820d..d02e112140 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-flip-comparisons.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-flip-comparisons.md @@ -33,9 +33,7 @@ npm install babel-plugin-minify-flip-comparisons ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-guarded-expressions.md b/website/versioned_docs/version-6.26.3/plugin-minify-guarded-expressions.md index 6abfb9e5ee..50c98e5231 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-guarded-expressions.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-guarded-expressions.md @@ -27,9 +27,7 @@ npm install babel-plugin-minify-guarded-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-infinity.md b/website/versioned_docs/version-6.26.3/plugin-minify-infinity.md index 78bcd9f5a6..ed4159d424 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-infinity.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-infinity.md @@ -25,9 +25,7 @@ npm install babel-plugin-minify-infinity ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-mangle-names.md b/website/versioned_docs/version-6.26.3/plugin-minify-mangle-names.md index d08fb381cf..117ad63d1f 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-mangle-names.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-mangle-names.md @@ -39,9 +39,7 @@ npm install babel-plugin-minify-mangle-names ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-numeric-literals.md b/website/versioned_docs/version-6.26.3/plugin-minify-numeric-literals.md index c95fcf9a9d..d1aa7b2938 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-numeric-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-numeric-literals.md @@ -27,9 +27,7 @@ npm install babel-plugin-minify-numeric-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-replace.md b/website/versioned_docs/version-6.26.3/plugin-minify-replace.md index df379e7fe5..64a9d2424d 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-replace.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-replace.md @@ -51,9 +51,7 @@ npm install babel-plugin-minify-replace ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-simplify.md b/website/versioned_docs/version-6.26.3/plugin-minify-simplify.md index bda98cb72e..9b8fce19fb 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-simplify.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-simplify.md @@ -59,9 +59,7 @@ npm install babel-plugin-minify-simplify ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-minify-type-constructors.md b/website/versioned_docs/version-6.26.3/plugin-minify-type-constructors.md index b3ec1c3cda..f3cd671b6e 100644 --- a/website/versioned_docs/version-6.26.3/plugin-minify-type-constructors.md +++ b/website/versioned_docs/version-6.26.3/plugin-minify-type-constructors.md @@ -37,9 +37,7 @@ npm install babel-plugin-minify-type-constructors ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-async-functions.md b/website/versioned_docs/version-6.26.3/plugin-syntax-async-functions.md index 2be9315318..f9d9929a89 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-async-functions.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-async-functions.md @@ -24,9 +24,7 @@ npm install --save-dev babel-plugin-syntax-async-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-async-generators.md b/website/versioned_docs/version-6.26.3/plugin-syntax-async-generators.md index fe12fb68bc..bd9c584cf0 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-async-generators.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-async-generators.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-syntax-async-generators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-class-constructor-call.md b/website/versioned_docs/version-6.26.3/plugin-syntax-class-constructor-call.md index a50fa1932e..cf3f945396 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-class-constructor-call.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-class-constructor-call.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-class-constructor-call ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-class-properties.md b/website/versioned_docs/version-6.26.3/plugin-syntax-class-properties.md index ac7b770a39..1198ad9d7b 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-class-properties.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-class-properties.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-class-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-decorators.md b/website/versioned_docs/version-6.26.3/plugin-syntax-decorators.md index 763823eb47..ca8f132013 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-decorators.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-decorators.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-decorators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-do-expressions.md b/website/versioned_docs/version-6.26.3/plugin-syntax-do-expressions.md index 37eaf58d21..c705df49c7 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-do-expressions.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-do-expressions.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-do-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-dynamic-import.md b/website/versioned_docs/version-6.26.3/plugin-syntax-dynamic-import.md index 766e88d473..12da68e7c3 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-dynamic-import.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-dynamic-import.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-dynamic-import ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-exponentiation-operator.md b/website/versioned_docs/version-6.26.3/plugin-syntax-exponentiation-operator.md index 35febeb836..9ad6a13f74 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-exponentiation-operator.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-exponentiation-operator.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-exponentiation-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-export-extensions.md b/website/versioned_docs/version-6.26.3/plugin-syntax-export-extensions.md index d29d82f8dc..6a8692490b 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-export-extensions.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-export-extensions.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-export-extensions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-flow.md b/website/versioned_docs/version-6.26.3/plugin-syntax-flow.md index 6cd00ff536..e467246348 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-flow.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-flow.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-flow ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-function-bind.md b/website/versioned_docs/version-6.26.3/plugin-syntax-function-bind.md index ecbe65530c..577ac44b2e 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-function-bind.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-function-bind.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-function-bind ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-function-sent.md b/website/versioned_docs/version-6.26.3/plugin-syntax-function-sent.md index 30147c18ea..4a0f3375f1 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-function-sent.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-function-sent.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-function-sent ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-jsx.md b/website/versioned_docs/version-6.26.3/plugin-syntax-jsx.md index 99769a56e6..c423fe4d65 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-jsx.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-jsx.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-jsx ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-object-rest-spread.md b/website/versioned_docs/version-6.26.3/plugin-syntax-object-rest-spread.md index ca0b2954f3..6ed814f91c 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-object-rest-spread.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-object-rest-spread.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-syntax-object-rest-spread ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-syntax-trailing-function-commas.md b/website/versioned_docs/version-6.26.3/plugin-syntax-trailing-function-commas.md index c304ccab81..44278b159f 100644 --- a/website/versioned_docs/version-6.26.3/plugin-syntax-trailing-function-commas.md +++ b/website/versioned_docs/version-6.26.3/plugin-syntax-trailing-function-commas.md @@ -94,9 +94,7 @@ npm install --save-dev babel-plugin-syntax-trailing-function-commas ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-async-functions.md b/website/versioned_docs/version-6.26.3/plugin-transform-async-functions.md index eef28ebe6b..66f52e6efa 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-async-functions.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-async-functions.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-async-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-async-generator-functions.md b/website/versioned_docs/version-6.26.3/plugin-transform-async-generator-functions.md index 5a2d04cf4e..26f10d3eff 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-async-generator-functions.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-async-generator-functions.md @@ -81,9 +81,7 @@ npm install --save-dev babel-plugin-transform-async-generator-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-async-to-generator.md b/website/versioned_docs/version-6.26.3/plugin-transform-async-to-generator.md index 2867bfd7da..da705f9e2b 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-async-to-generator.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-async-to-generator.md @@ -34,9 +34,7 @@ npm install --save-dev babel-plugin-transform-async-to-generator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-async-to-module-method.md b/website/versioned_docs/version-6.26.3/plugin-transform-async-to-module-method.md index b22d2ba09d..bb29d7fe74 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-async-to-module-method.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-async-to-module-method.md @@ -33,9 +33,7 @@ npm install --save-dev babel-plugin-transform-async-to-module-method ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-class-constructor-call.md b/website/versioned_docs/version-6.26.3/plugin-transform-class-constructor-call.md index 20760c5a6a..46111bfb22 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-class-constructor-call.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-class-constructor-call.md @@ -75,9 +75,7 @@ npm install --save-dev babel-plugin-transform-class-constructor-call ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-class-properties.md b/website/versioned_docs/version-6.26.3/plugin-transform-class-properties.md index 63b10f9c12..9126c65e84 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-class-properties.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-class-properties.md @@ -45,9 +45,7 @@ npm install --save-dev babel-plugin-transform-class-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-decorators.md b/website/versioned_docs/version-6.26.3/plugin-transform-decorators.md index 738cac8186..8e3ac7d226 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-decorators.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-decorators.md @@ -61,9 +61,7 @@ npm install --save-dev babel-plugin-transform-decorators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-do-expressions.md b/website/versioned_docs/version-6.26.3/plugin-transform-do-expressions.md index bf86037999..26e06ef1f9 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-do-expressions.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-do-expressions.md @@ -91,9 +91,7 @@ npm install --save-dev babel-plugin-transform-do-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-arrow-functions.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-arrow-functions.md index f2dca73ab7..357636b608 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-arrow-functions.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-arrow-functions.md @@ -62,9 +62,7 @@ npm install --save-dev babel-plugin-transform-es2015-arrow-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoped-functions.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoped-functions.md index bf6eb103e6..3f487dbfd3 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoped-functions.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoped-functions.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-es2015-block-scoped-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoping.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoping.md index 1be703a751..6abf21bcf8 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoping.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-block-scoping.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-es2015-block-scoping ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-classes.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-classes.md index 17c6ba8251..db78cb7beb 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-classes.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-classes.md @@ -19,9 +19,7 @@ npm install --save-dev babel-plugin-transform-es2015-classes ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```js // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-computed-properties.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-computed-properties.md index fedd6ca52e..de77e7834a 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-computed-properties.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-computed-properties.md @@ -56,9 +56,7 @@ npm install --save-dev babel-plugin-transform-es2015-computed-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-destructuring.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-destructuring.md index d7f5d11469..573ce847d9 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-destructuring.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-destructuring.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-es2015-destructuring ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-duplicate-keys.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-duplicate-keys.md index 814652a6ae..b74652f164 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-duplicate-keys.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-duplicate-keys.md @@ -39,9 +39,7 @@ npm install --save-dev babel-plugin-transform-es2015-duplicate-keys ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-for-of.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-for-of.md index 0cb3f0ac1d..bf28b9a73f 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-for-of.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-for-of.md @@ -48,9 +48,7 @@ npm install --save-dev babel-plugin-transform-es2015-for-of ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-function-name.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-function-name.md index 57a550c192..326dcbc02f 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-function-name.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-function-name.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-es2015-function-name ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-instanceof.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-instanceof.md index f4f3e700c7..ddf13cc175 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-instanceof.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-instanceof.md @@ -11,9 +11,7 @@ npm install --save-dev babel-plugin-transform-es2015-instanceof ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-literals.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-literals.md index 2ce1a80e8d..2da8292169 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-literals.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-transform-es2015-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-amd.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-amd.md index d0a5e96595..aa301e5413 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-amd.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-amd.md @@ -35,9 +35,7 @@ npm install --save-dev babel-plugin-transform-es2015-modules-amd ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-commonjs.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-commonjs.md index 4729b70a1f..497e99403d 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-commonjs.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-commonjs.md @@ -39,9 +39,7 @@ npm install --save-dev babel-plugin-transform-es2015-modules-commonjs ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```js // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-systemjs.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-systemjs.md index f8de781a88..390f2aea16 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-systemjs.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-systemjs.md @@ -34,9 +34,7 @@ npm install --save-dev babel-plugin-transform-es2015-modules-systemjs ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-umd.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-umd.md index 8ca8d75a78..686aa9fb3a 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-umd.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-modules-umd.md @@ -47,9 +47,7 @@ npm install --save-dev babel-plugin-transform-es2015-modules-umd ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-object-super.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-object-super.md index 6b7fa9e2a3..b523887694 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-object-super.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-object-super.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-es2015-object-super ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-parameters.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-parameters.md index 82f7c61285..e941f7e2d0 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-parameters.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-parameters.md @@ -25,9 +25,7 @@ not supported in your environment then you'll need the ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-shorthand-properties.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-shorthand-properties.md index 486bd6cab8..cfd8681e92 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-shorthand-properties.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-shorthand-properties.md @@ -47,9 +47,7 @@ npm install --save-dev babel-plugin-transform-es2015-shorthand-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-spread.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-spread.md index 8dd4d67fe7..9f77aba50d 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-spread.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-spread.md @@ -29,9 +29,7 @@ npm install --save-dev babel-plugin-transform-es2015-spread ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-sticky-regex.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-sticky-regex.md index 6cd50c8b9c..8b92fd5cd4 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-sticky-regex.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-sticky-regex.md @@ -13,9 +13,7 @@ npm install --save-dev babel-plugin-transform-es2015-sticky-regex ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-template-literals.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-template-literals.md index ab3b7e6f3e..055d811566 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-template-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-template-literals.md @@ -27,9 +27,7 @@ npm install --save-dev babel-plugin-transform-es2015-template-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-typeof-symbol.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-typeof-symbol.md index f2d49f02a9..0e1ea7ed8d 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-typeof-symbol.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-typeof-symbol.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-transform-es2015-typeof-symbol ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-unicode-regex.md b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-unicode-regex.md index adecc6d931..2c07258a5f 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es2015-unicode-regex.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es2015-unicode-regex.md @@ -29,9 +29,7 @@ npm install --save-dev babel-plugin-transform-es2015-unicode-regex ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es3-member-expression-literals.md b/website/versioned_docs/version-6.26.3/plugin-transform-es3-member-expression-literals.md index 396709a836..cbc4c39720 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es3-member-expression-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es3-member-expression-literals.md @@ -27,9 +27,7 @@ npm install --save-dev babel-plugin-transform-es3-member-expression-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es3-property-literals.md b/website/versioned_docs/version-6.26.3/plugin-transform-es3-property-literals.md index e1a89562ab..cdfef4ee85 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es3-property-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es3-property-literals.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-transform-es3-property-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-es5-property-mutators.md b/website/versioned_docs/version-6.26.3/plugin-transform-es5-property-mutators.md index 842f4749d9..fe7c3de2f1 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-es5-property-mutators.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-es5-property-mutators.md @@ -39,9 +39,7 @@ npm install --save-dev babel-plugin-transform-es5-property-mutators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-eval.md b/website/versioned_docs/version-6.26.3/plugin-transform-eval.md index 82c0fe3c69..6154879fe0 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-eval.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-eval.md @@ -27,9 +27,7 @@ npm install --save-dev babel-plugin-transform-eval ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-exponentiation-operator.md b/website/versioned_docs/version-6.26.3/plugin-transform-exponentiation-operator.md index ba4159115f..0d25c15014 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-exponentiation-operator.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-exponentiation-operator.md @@ -36,9 +36,7 @@ npm install --save-dev babel-plugin-transform-exponentiation-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-export-extensions.md b/website/versioned_docs/version-6.26.3/plugin-transform-export-extensions.md index ce6197192a..2f77ca3038 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-export-extensions.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-export-extensions.md @@ -20,9 +20,7 @@ npm install --save-dev babel-plugin-transform-export-extensions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-flow-comments.md b/website/versioned_docs/version-6.26.3/plugin-transform-flow-comments.md index 3f26cba088..23cea065c1 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-flow-comments.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-flow-comments.md @@ -49,9 +49,7 @@ npm install --save-dev babel-plugin-transform-flow-comments ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-flow-strip-types.md b/website/versioned_docs/version-6.26.3/plugin-transform-flow-strip-types.md index e3b0334fe9..bffd362efa 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-flow-strip-types.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-flow-strip-types.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-transform-flow-strip-types ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-function-bind.md b/website/versioned_docs/version-6.26.3/plugin-transform-function-bind.md index 8e5b03a258..6dc4195804 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-function-bind.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-function-bind.md @@ -94,9 +94,7 @@ npm install --save-dev babel-plugin-transform-function-bind ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-inline-consecutive-adds.md b/website/versioned_docs/version-6.26.3/plugin-transform-inline-consecutive-adds.md index e340f1b858..6da4735254 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-inline-consecutive-adds.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-inline-consecutive-adds.md @@ -44,9 +44,7 @@ npm install babel-plugin-transform-inline-consecutive-adds ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-inline-environment-variables.md b/website/versioned_docs/version-6.26.3/plugin-transform-inline-environment-variables.md index 457c1f565f..1129a36ae3 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-inline-environment-variables.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-inline-environment-variables.md @@ -28,9 +28,7 @@ npm install babel-plugin-transform-inline-environment-variables ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-jscript.md b/website/versioned_docs/version-6.26.3/plugin-transform-jscript.md index 7ccb208423..212664d696 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-jscript.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-jscript.md @@ -35,9 +35,7 @@ npm install --save-dev babel-plugin-transform-jscript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-member-expression-literals.md b/website/versioned_docs/version-6.26.3/plugin-transform-member-expression-literals.md index 589f9a51d0..f43e00d14d 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-member-expression-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-member-expression-literals.md @@ -33,9 +33,7 @@ npm install babel-plugin-transform-member-expression-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-merge-sibling-variables.md b/website/versioned_docs/version-6.26.3/plugin-transform-merge-sibling-variables.md index 8dcf175a9c..b86086f746 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-merge-sibling-variables.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-merge-sibling-variables.md @@ -38,9 +38,7 @@ npm install babel-plugin-transform-merge-sibling-variables ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-minify-booleans.md b/website/versioned_docs/version-6.26.3/plugin-transform-minify-booleans.md index 27639da752..8110abfa95 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-minify-booleans.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-minify-booleans.md @@ -29,9 +29,7 @@ npm install babel-plugin-transform-minify-booleans ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-node-env-inline.md b/website/versioned_docs/version-6.26.3/plugin-transform-node-env-inline.md index 24d55f022c..1af8f6e21f 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-node-env-inline.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-node-env-inline.md @@ -34,9 +34,7 @@ npm install babel-plugin-transform-node-env-inline ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-object-assign.md b/website/versioned_docs/version-6.26.3/plugin-transform-object-assign.md index 97a6aedb97..84e4bec414 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-object-assign.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-object-assign.md @@ -38,9 +38,7 @@ npm install --save-dev babel-plugin-transform-object-assign ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-object-rest-spread.md b/website/versioned_docs/version-6.26.3/plugin-transform-object-rest-spread.md index 5557c00e8c..06b7a1d65a 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-object-rest-spread.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-object-rest-spread.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-transform-object-rest-spread ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-object-set-prototype-of-to-assign.md b/website/versioned_docs/version-6.26.3/plugin-transform-object-set-prototype-of-to-assign.md index bc9f9c301f..a609a9dbb3 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-object-set-prototype-of-to-assign.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-object-set-prototype-of-to-assign.md @@ -31,9 +31,7 @@ npm install --save-dev babel-plugin-transform-object-set-prototype-of-to-assign ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-property-literals.md b/website/versioned_docs/version-6.26.3/plugin-transform-property-literals.md index b023deef4c..3d14e8aab4 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-property-literals.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-property-literals.md @@ -43,9 +43,7 @@ npm install babel-plugin-transform-property-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-proto-to-assign.md b/website/versioned_docs/version-6.26.3/plugin-transform-proto-to-assign.md index e1500a850e..c1a605a283 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-proto-to-assign.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-proto-to-assign.md @@ -54,9 +54,7 @@ npm install --save-dev babel-plugin-transform-proto-to-assign ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-constant-elements.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-constant-elements.md index 992e9b5565..40bb6dfa64 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-constant-elements.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-constant-elements.md @@ -52,9 +52,7 @@ npm install --save-dev babel-plugin-transform-react-constant-elements ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-display-name.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-display-name.md index d455646897..1a8b69848a 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-display-name.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-display-name.md @@ -33,9 +33,7 @@ npm install --save-dev babel-plugin-transform-react-display-name ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-inline-elements.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-inline-elements.md index 0a8cf1058c..6a7ece343b 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-inline-elements.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-inline-elements.md @@ -46,9 +46,7 @@ npm install --save-dev babel-plugin-transform-react-inline-elements ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-compat.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-compat.md index a74af59be2..bacc7c48f6 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-compat.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-compat.md @@ -33,9 +33,7 @@ npm install --save-dev babel-plugin-transform-react-jsx-compat ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-self.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-self.md index 38925a51b0..8504ae0b25 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-self.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-self.md @@ -27,9 +27,7 @@ npm install --save-dev babel-plugin-transform-react-jsx-self ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-source.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-source.md index ad15f13c3c..024584ee12 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-source.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx-source.md @@ -27,9 +27,7 @@ npm install --save-dev babel-plugin-transform-react-jsx-source ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx.md b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx.md index 970ebadf10..70c6422856 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-react-jsx.md @@ -80,9 +80,7 @@ npm install --save-dev babel-plugin-transform-react-jsx ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-regenerator.md b/website/versioned_docs/version-6.26.3/plugin-transform-regenerator.md index 28ac30d28d..42f89c260e 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-regenerator.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-regenerator.md @@ -54,7 +54,7 @@ npm install --save-dev babel-plugin-transform-regenerator ## Usage -### Via `.babelrc` (Recommended) +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-regexp-constructors.md b/website/versioned_docs/version-6.26.3/plugin-transform-regexp-constructors.md index 97a7de8bc7..84ae4f4e4c 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-regexp-constructors.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-regexp-constructors.md @@ -29,9 +29,7 @@ npm install babel-plugin-transform-regexp-constructors ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-remove-console.md b/website/versioned_docs/version-6.26.3/plugin-transform-remove-console.md index 7fb028d875..adef13f484 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-remove-console.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-remove-console.md @@ -27,9 +27,7 @@ npm install babel-plugin-transform-remove-console ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-remove-debugger.md b/website/versioned_docs/version-6.26.3/plugin-transform-remove-debugger.md index 3270b90599..1eca9a0751 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-remove-debugger.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-remove-debugger.md @@ -26,9 +26,7 @@ npm install babel-plugin-transform-remove-debugger ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-remove-undefined.md b/website/versioned_docs/version-6.26.3/plugin-transform-remove-undefined.md index 016d861d8c..dc5aeaf7ec 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-remove-undefined.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-remove-undefined.md @@ -37,9 +37,7 @@ npm install babel-plugin-transform-remove-undefined ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-runtime.md b/website/versioned_docs/version-6.26.3/plugin-transform-runtime.md index e902a3b432..61117a2285 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-runtime.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-runtime.md @@ -39,9 +39,7 @@ The transformation plugin is typically used only in development, but the runtime ## Usage -### Via `.babelrc` (Recommended) - -Add the following line to your `.babelrc` file: +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-simplify-comparison-operators.md b/website/versioned_docs/version-6.26.3/plugin-transform-simplify-comparison-operators.md index f5578595b0..2641a6603c 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-simplify-comparison-operators.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-simplify-comparison-operators.md @@ -27,9 +27,7 @@ npm install babel-plugin-transform-simplify-comparison-operators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-strict-mode.md b/website/versioned_docs/version-6.26.3/plugin-transform-strict-mode.md index 5e31ca4068..6584c3ff65 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-strict-mode.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-strict-mode.md @@ -33,9 +33,7 @@ npm install --save-dev babel-plugin-transform-strict-mode ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-6.26.3/plugin-transform-undefined-to-void.md b/website/versioned_docs/version-6.26.3/plugin-transform-undefined-to-void.md index 6023eba10f..bb949c1596 100644 --- a/website/versioned_docs/version-6.26.3/plugin-transform-undefined-to-void.md +++ b/website/versioned_docs/version-6.26.3/plugin-transform-undefined-to-void.md @@ -29,9 +29,7 @@ npm install babel-plugin-transform-undefined-to-void ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/plugin-undeclared-variables-check.md b/website/versioned_docs/version-6.26.3/plugin-undeclared-variables-check.md index 69c4d6bb8a..32bac01820 100644 --- a/website/versioned_docs/version-6.26.3/plugin-undeclared-variables-check.md +++ b/website/versioned_docs/version-6.26.3/plugin-undeclared-variables-check.md @@ -34,9 +34,7 @@ npm install --save-dev babel-plugin-undeclared-variables-check ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-es2015.md b/website/versioned_docs/version-6.26.3/preset-es2015.md index 31bc91d4c1..59315ea9f5 100644 --- a/website/versioned_docs/version-6.26.3/preset-es2015.md +++ b/website/versioned_docs/version-6.26.3/preset-es2015.md @@ -39,9 +39,7 @@ npm install --save-dev babel-preset-es2015 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-es2016.md b/website/versioned_docs/version-6.26.3/preset-es2016.md index f22fb40af1..daa08daa8f 100644 --- a/website/versioned_docs/version-6.26.3/preset-es2016.md +++ b/website/versioned_docs/version-6.26.3/preset-es2016.md @@ -19,9 +19,7 @@ npm install --save-dev babel-preset-es2016 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-es2017.md b/website/versioned_docs/version-6.26.3/preset-es2017.md index 74e08d46d5..382425ad9d 100644 --- a/website/versioned_docs/version-6.26.3/preset-es2017.md +++ b/website/versioned_docs/version-6.26.3/preset-es2017.md @@ -20,9 +20,7 @@ npm install --save-dev babel-preset-es2017 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-flow.md b/website/versioned_docs/version-6.26.3/preset-flow.md index a8e4631ab7..2648710a29 100644 --- a/website/versioned_docs/version-6.26.3/preset-flow.md +++ b/website/versioned_docs/version-6.26.3/preset-flow.md @@ -31,9 +31,7 @@ npm install --save-dev babel-preset-flow ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-latest.md b/website/versioned_docs/version-6.26.3/preset-latest.md index c1ab2a12a6..14d9d3ea8d 100644 --- a/website/versioned_docs/version-6.26.3/preset-latest.md +++ b/website/versioned_docs/version-6.26.3/preset-latest.md @@ -23,9 +23,7 @@ npm install --save-dev babel-preset-latest ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-minify.md b/website/versioned_docs/version-6.26.3/preset-minify.md index a8f5e85f6c..91ea0b8196 100644 --- a/website/versioned_docs/version-6.26.3/preset-minify.md +++ b/website/versioned_docs/version-6.26.3/preset-minify.md @@ -17,9 +17,7 @@ npm install --save-dev babel-preset-minify ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-react.md b/website/versioned_docs/version-6.26.3/preset-react.md index f6308ad960..c7eca35ecd 100644 --- a/website/versioned_docs/version-6.26.3/preset-react.md +++ b/website/versioned_docs/version-6.26.3/preset-react.md @@ -50,9 +50,7 @@ View the output ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-stage-0.md b/website/versioned_docs/version-6.26.3/preset-stage-0.md index dc67c57408..92a842bc10 100644 --- a/website/versioned_docs/version-6.26.3/preset-stage-0.md +++ b/website/versioned_docs/version-6.26.3/preset-stage-0.md @@ -34,9 +34,7 @@ npm install --save-dev babel-preset-stage-0 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-stage-1.md b/website/versioned_docs/version-6.26.3/preset-stage-1.md index ff4eb69854..4ee29d9288 100644 --- a/website/versioned_docs/version-6.26.3/preset-stage-1.md +++ b/website/versioned_docs/version-6.26.3/preset-stage-1.md @@ -35,9 +35,7 @@ npm install --save-dev babel-preset-stage-1 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-stage-2.md b/website/versioned_docs/version-6.26.3/preset-stage-2.md index 3f689b4587..6ffbbc91f1 100644 --- a/website/versioned_docs/version-6.26.3/preset-stage-2.md +++ b/website/versioned_docs/version-6.26.3/preset-stage-2.md @@ -35,9 +35,7 @@ npm install --save-dev babel-preset-stage-2 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-6.26.3/preset-stage-3.md b/website/versioned_docs/version-6.26.3/preset-stage-3.md index 7ece92d7ce..a891d8b2be 100644 --- a/website/versioned_docs/version-6.26.3/preset-stage-3.md +++ b/website/versioned_docs/version-6.26.3/preset-stage-3.md @@ -34,9 +34,7 @@ npm install --save-dev babel-preset-stage-3 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-external-helpers.md b/website/versioned_docs/version-7.0.0/plugin-external-helpers.md index 2349bbaee3..8f43a720f8 100644 --- a/website/versioned_docs/version-7.0.0/plugin-external-helpers.md +++ b/website/versioned_docs/version-7.0.0/plugin-external-helpers.md @@ -11,9 +11,7 @@ npm install --save-dev @babel/plugin-external-helpers ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-builtins.md b/website/versioned_docs/version-7.0.0/plugin-minify-builtins.md index ba0bcdd1ff..9d1e7d2ddd 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-builtins.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-builtins.md @@ -29,9 +29,7 @@ npm install babel-plugin-minify-builtins --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-constant-folding.md b/website/versioned_docs/version-7.0.0/plugin-minify-constant-folding.md index dcd8a8d058..7e0191efb0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-constant-folding.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-constant-folding.md @@ -64,9 +64,7 @@ npm install babel-plugin-minify-constant-folding --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-dead-code-elimination.md b/website/versioned_docs/version-7.0.0/plugin-minify-dead-code-elimination.md index 8e13c58219..8c89e3c69e 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-dead-code-elimination.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-dead-code-elimination.md @@ -39,9 +39,7 @@ npm install babel-plugin-minify-dead-code-elimination --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-flip-comparisons.md b/website/versioned_docs/version-7.0.0/plugin-minify-flip-comparisons.md index 279c6300c1..d4148d9d78 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-flip-comparisons.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-flip-comparisons.md @@ -33,9 +33,7 @@ npm install babel-plugin-minify-flip-comparisons --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-guarded-expressions.md b/website/versioned_docs/version-7.0.0/plugin-minify-guarded-expressions.md index 75915da0dc..d38a6bc306 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-guarded-expressions.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-guarded-expressions.md @@ -27,9 +27,7 @@ npm install babel-plugin-minify-guarded-expressions --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-infinity.md b/website/versioned_docs/version-7.0.0/plugin-minify-infinity.md index 4bae51372c..f252059b5b 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-infinity.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-infinity.md @@ -25,9 +25,7 @@ npm install babel-plugin-minify-infinity --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-mangle-names.md b/website/versioned_docs/version-7.0.0/plugin-minify-mangle-names.md index 58a085eb55..31921d41ca 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-mangle-names.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-mangle-names.md @@ -39,9 +39,7 @@ npm install babel-plugin-minify-mangle-names --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-numeric-literals.md b/website/versioned_docs/version-7.0.0/plugin-minify-numeric-literals.md index a55dcaf251..7ab674632e 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-numeric-literals.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-numeric-literals.md @@ -27,9 +27,7 @@ npm install babel-plugin-minify-numeric-literals --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-replace.md b/website/versioned_docs/version-7.0.0/plugin-minify-replace.md index 14a6b10598..0e42e5bce3 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-replace.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-replace.md @@ -51,9 +51,7 @@ npm install babel-plugin-minify-replace --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-simplify.md b/website/versioned_docs/version-7.0.0/plugin-minify-simplify.md index 9c728c1e97..1a6c4efcf3 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-simplify.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-simplify.md @@ -59,9 +59,7 @@ npm install babel-plugin-minify-simplify --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-minify-type-constructors.md b/website/versioned_docs/version-7.0.0/plugin-minify-type-constructors.md index 05be6f5366..6c3c18906a 100644 --- a/website/versioned_docs/version-7.0.0/plugin-minify-type-constructors.md +++ b/website/versioned_docs/version-7.0.0/plugin-minify-type-constructors.md @@ -37,9 +37,7 @@ npm install babel-plugin-minify-type-constructors --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-async-generator-functions.md b/website/versioned_docs/version-7.0.0/plugin-proposal-async-generator-functions.md index ce9ed7a518..b4345a6311 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-async-generator-functions.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-async-generator-functions.md @@ -81,9 +81,7 @@ npm install --save-dev @babel/plugin-proposal-async-generator-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-class-properties.md b/website/versioned_docs/version-7.0.0/plugin-proposal-class-properties.md index 50d4f5b7f3..9c0527923d 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-class-properties.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-class-properties.md @@ -45,9 +45,7 @@ npm install --save-dev @babel/plugin-proposal-class-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-decorators.md b/website/versioned_docs/version-7.0.0/plugin-proposal-decorators.md index 2867198d1f..1efa86b605 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-decorators.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-decorators.md @@ -57,7 +57,7 @@ npm install --save-dev @babel/plugin-proposal-decorators ## Usage -Add the following line to your .babelrc file: +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-do-expressions.md b/website/versioned_docs/version-7.0.0/plugin-proposal-do-expressions.md index b738984a2a..6197a3af95 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-do-expressions.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-do-expressions.md @@ -91,9 +91,7 @@ npm install --save-dev @babel/plugin-proposal-do-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-export-default-from.md b/website/versioned_docs/version-7.0.0/plugin-proposal-export-default-from.md index e7c7b53afe..d369c2c290 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-export-default-from.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-export-default-from.md @@ -19,9 +19,7 @@ npm install --save-dev @babel/plugin-proposal-export-default-from ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-export-namespace-from.md b/website/versioned_docs/version-7.0.0/plugin-proposal-export-namespace-from.md index e5b20a042c..933558eb64 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-export-namespace-from.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-export-namespace-from.md @@ -19,9 +19,7 @@ npm install --save-dev @babel/plugin-proposal-export-namespace-from ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-function-bind.md b/website/versioned_docs/version-7.0.0/plugin-proposal-function-bind.md index 076119b0d1..e3af4ddef1 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-function-bind.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-function-bind.md @@ -94,9 +94,7 @@ npm install --save-dev @babel/plugin-proposal-function-bind ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-function-sent.md b/website/versioned_docs/version-7.0.0/plugin-proposal-function-sent.md index e7eeb9f1d5..2769779ead 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-function-sent.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-function-sent.md @@ -40,9 +40,7 @@ npm install --save-dev @babel/plugin-proposal-function-sent ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-json-strings.md b/website/versioned_docs/version-7.0.0/plugin-proposal-json-strings.md index 7fa99da2a7..eff267ea0c 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-json-strings.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-json-strings.md @@ -29,9 +29,7 @@ npm install --save-dev @babel/plugin-proposal-json-strings ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-logical-assignment-operators.md b/website/versioned_docs/version-7.0.0/plugin-proposal-logical-assignment-operators.md index 66a72b18a4..b4079a362a 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-logical-assignment-operators.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-logical-assignment-operators.md @@ -37,9 +37,7 @@ npm install --save-dev @babel/plugin-proposal-logical-assignment-operators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-nullish-coalescing-operator.md b/website/versioned_docs/version-7.0.0/plugin-proposal-nullish-coalescing-operator.md index 2d51daa4c6..ccd079ea89 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-nullish-coalescing-operator.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-nullish-coalescing-operator.md @@ -32,9 +32,7 @@ npm install --save-dev @babel/plugin-proposal-nullish-coalescing-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-numeric-separator.md b/website/versioned_docs/version-7.0.0/plugin-proposal-numeric-separator.md index 1631351a58..f770932437 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-numeric-separator.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-numeric-separator.md @@ -68,9 +68,7 @@ npm install --save-dev @babel/plugin-proposal-numeric-separator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { @@ -98,9 +96,7 @@ If you need to further compile ES2015 Decimal, Binary, Hex and Octal number repr > `@babel/plugin-transform-literals` is already included in [@babel/preset-env](preset-env.md) and @babel/preset-es2015. -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-object-rest-spread.md b/website/versioned_docs/version-7.0.0/plugin-proposal-object-rest-spread.md index cb7d22e050..b93f7ba279 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-object-rest-spread.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-object-rest-spread.md @@ -31,9 +31,7 @@ npm install --save-dev @babel/plugin-proposal-object-rest-spread ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-optional-catch-binding.md b/website/versioned_docs/version-7.0.0/plugin-proposal-optional-catch-binding.md index 4aedd62572..e6ac1940b2 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-optional-catch-binding.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-optional-catch-binding.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-proposal-optional-catch-binding ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-optional-chaining.md b/website/versioned_docs/version-7.0.0/plugin-proposal-optional-chaining.md index 956337e8a1..0e42fb690d 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-optional-chaining.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-optional-chaining.md @@ -95,9 +95,7 @@ npm install --save-dev @babel/plugin-proposal-optional-chaining ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-pipeline-operator.md b/website/versioned_docs/version-7.0.0/plugin-proposal-pipeline-operator.md index ae195b84ea..dc046aed24 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-pipeline-operator.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-pipeline-operator.md @@ -13,9 +13,7 @@ $ npm install --save-dev @babel/plugin-proposal-pipeline-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-throw-expressions.md b/website/versioned_docs/version-7.0.0/plugin-proposal-throw-expressions.md index 7b77967865..7b2ee6927f 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-throw-expressions.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-throw-expressions.md @@ -21,9 +21,7 @@ npm install --save-dev @babel/plugin-proposal-throw-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-proposal-unicode-property-regex.md b/website/versioned_docs/version-7.0.0/plugin-proposal-unicode-property-regex.md index 1f5dc3d5c2..d052518da1 100644 --- a/website/versioned_docs/version-7.0.0/plugin-proposal-unicode-property-regex.md +++ b/website/versioned_docs/version-7.0.0/plugin-proposal-unicode-property-regex.md @@ -15,7 +15,7 @@ npm install --save-dev @babel/plugin-proposal-unicode-property-regex ## Usage -### Via `.babelrc` (recommended) +### With a configuration file (Recommended) `.babelrc` diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-async-generators.md b/website/versioned_docs/version-7.0.0/plugin-syntax-async-generators.md index 9ae78bdee3..7341e44674 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-async-generators.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-async-generators.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-syntax-async-generators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-bigint.md b/website/versioned_docs/version-7.0.0/plugin-syntax-bigint.md index 22e08e75bf..ace054f9b4 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-bigint.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-bigint.md @@ -14,9 +14,7 @@ npm install --save-dev @babel/plugin-syntax-bigint ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-class-properties.md b/website/versioned_docs/version-7.0.0/plugin-syntax-class-properties.md index 323ab4c8ca..1732c50fa5 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-class-properties.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-class-properties.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-class-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-decorators.md b/website/versioned_docs/version-7.0.0/plugin-syntax-decorators.md index 83922444ba..879f3257aa 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-decorators.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-decorators.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-decorators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-do-expressions.md b/website/versioned_docs/version-7.0.0/plugin-syntax-do-expressions.md index 9e11ec36e6..deee63166d 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-do-expressions.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-do-expressions.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-do-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-dynamic-import.md b/website/versioned_docs/version-7.0.0/plugin-syntax-dynamic-import.md index f6e5ee5152..369dee4966 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-dynamic-import.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-dynamic-import.md @@ -13,9 +13,7 @@ npm install --save-dev @babel/plugin-syntax-dynamic-import ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-export-default-from.md b/website/versioned_docs/version-7.0.0/plugin-syntax-export-default-from.md index 662969f7e3..3288b31a8e 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-export-default-from.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-export-default-from.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-export-default-from ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-export-namespace-from.md b/website/versioned_docs/version-7.0.0/plugin-syntax-export-namespace-from.md index 0c8117628e..8911f0e4ab 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-export-namespace-from.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-export-namespace-from.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-export-namespace-from ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-flow.md b/website/versioned_docs/version-7.0.0/plugin-syntax-flow.md index 4e34b6393d..1d74c6efb8 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-flow.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-flow.md @@ -13,9 +13,7 @@ npm install --save-dev @babel/plugin-syntax-flow ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-function-bind.md b/website/versioned_docs/version-7.0.0/plugin-syntax-function-bind.md index 6c788f61d0..e3f5ca5cb8 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-function-bind.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-function-bind.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-function-bind ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-function-sent.md b/website/versioned_docs/version-7.0.0/plugin-syntax-function-sent.md index abd0b0e9b7..f2f2c3fc3e 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-function-sent.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-function-sent.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-function-sent ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-import-meta.md b/website/versioned_docs/version-7.0.0/plugin-syntax-import-meta.md index b443ebe4ad..e0bb58c0b0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-import-meta.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-import-meta.md @@ -13,9 +13,7 @@ npm install --save-dev @babel/plugin-syntax-import-meta ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-json-strings.md b/website/versioned_docs/version-7.0.0/plugin-syntax-json-strings.md index 1dcd7d3358..7f9d335ced 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-json-strings.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-json-strings.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-json-strings ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-jsx.md b/website/versioned_docs/version-7.0.0/plugin-syntax-jsx.md index e50567ae4a..d9147487cb 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-jsx.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-jsx.md @@ -13,9 +13,7 @@ npm install --save-dev @babel/plugin-syntax-jsx ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-logical-assignment-operators.md b/website/versioned_docs/version-7.0.0/plugin-syntax-logical-assignment-operators.md index 10ed5473c1..1ffc4736bc 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-logical-assignment-operators.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-logical-assignment-operators.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-logical-assignment-operators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-nullish-coalescing-operator.md b/website/versioned_docs/version-7.0.0/plugin-syntax-nullish-coalescing-operator.md index f485217043..f6cdcf166b 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-nullish-coalescing-operator.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-nullish-coalescing-operator.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-nullish-coalescing-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-numeric-separator.md b/website/versioned_docs/version-7.0.0/plugin-syntax-numeric-separator.md index 251f558b34..e6a6ef71f1 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-numeric-separator.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-numeric-separator.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-numeric-separator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-object-rest-spread.md b/website/versioned_docs/version-7.0.0/plugin-syntax-object-rest-spread.md index e7aadbf945..573223c8b8 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-object-rest-spread.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-object-rest-spread.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-object-rest-spread ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-optional-catch-binding.md b/website/versioned_docs/version-7.0.0/plugin-syntax-optional-catch-binding.md index f3b57de676..ba20cabbcf 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-optional-catch-binding.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-optional-catch-binding.md @@ -30,9 +30,7 @@ npm install --save-dev @babel/plugin-syntax-optional-catch-binding ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-optional-chaining.md b/website/versioned_docs/version-7.0.0/plugin-syntax-optional-chaining.md index acf1d7932c..e4d9f0e5f3 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-optional-chaining.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-optional-chaining.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-optional-chaining ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-pipeline-operator.md b/website/versioned_docs/version-7.0.0/plugin-syntax-pipeline-operator.md index 2381ece9ee..a308352ecb 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-pipeline-operator.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-pipeline-operator.md @@ -17,9 +17,7 @@ $ npm install @babel/plugin-syntax-pipeline-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-throw-expressions.md b/website/versioned_docs/version-7.0.0/plugin-syntax-throw-expressions.md index 0b0e87d81d..6da65fed30 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-throw-expressions.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-throw-expressions.md @@ -24,9 +24,7 @@ npm install --save-dev @babel/plugin-syntax-throw-expressions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-syntax-typescript.md b/website/versioned_docs/version-7.0.0/plugin-syntax-typescript.md index b457417368..2b7d6bc8ff 100644 --- a/website/versioned_docs/version-7.0.0/plugin-syntax-typescript.md +++ b/website/versioned_docs/version-7.0.0/plugin-syntax-typescript.md @@ -11,9 +11,7 @@ npm install --save-dev @babel/plugin-syntax-typescript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-arrow-functions.md b/website/versioned_docs/version-7.0.0/plugin-transform-arrow-functions.md index db7e35afd1..c7270af0db 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-arrow-functions.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-arrow-functions.md @@ -62,9 +62,7 @@ npm install --save-dev @babel/plugin-transform-arrow-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-async-to-generator.md b/website/versioned_docs/version-7.0.0/plugin-transform-async-to-generator.md index ce5a1ec96c..24d4d12283 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-async-to-generator.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-async-to-generator.md @@ -48,9 +48,7 @@ npm install --save-dev @babel/plugin-transform-async-to-generator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-block-scoped-functions.md b/website/versioned_docs/version-7.0.0/plugin-transform-block-scoped-functions.md index fd5082762b..eb0e639453 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-block-scoped-functions.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-block-scoped-functions.md @@ -38,9 +38,7 @@ npm install --save-dev @babel/plugin-transform-block-scoped-functions ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-block-scoping.md b/website/versioned_docs/version-7.0.0/plugin-transform-block-scoping.md index d725977a59..2dbbcff3e9 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-block-scoping.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-block-scoping.md @@ -40,9 +40,7 @@ npm install --save-dev @babel/plugin-transform-block-scoping ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-classes.md b/website/versioned_docs/version-7.0.0/plugin-transform-classes.md index e2ebc8320c..5f0405f3a3 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-classes.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-classes.md @@ -79,9 +79,7 @@ npm install --save-dev @babel/plugin-transform-classes ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```js // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-computed-properties.md b/website/versioned_docs/version-7.0.0/plugin-transform-computed-properties.md index a02fcf09df..0c33557f7e 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-computed-properties.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-computed-properties.md @@ -56,9 +56,7 @@ npm install --save-dev @babel/plugin-transform-computed-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-destructuring.md b/website/versioned_docs/version-7.0.0/plugin-transform-destructuring.md index 5a3ceb7179..f5befa2108 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-destructuring.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-destructuring.md @@ -39,9 +39,7 @@ npm install --save-dev @babel/plugin-transform-destructuring ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-dotall-regex.md b/website/versioned_docs/version-7.0.0/plugin-transform-dotall-regex.md index e0ba27bc92..add2c076b4 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-dotall-regex.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-dotall-regex.md @@ -41,7 +41,7 @@ npm install --save-dev @babel/plugin-transform-dotall-regex ## Usage -### Via `.babelrc` (recommended) +### With a configuration file (Recommended) `.babelrc` diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-duplicate-keys.md b/website/versioned_docs/version-7.0.0/plugin-transform-duplicate-keys.md index 9623990638..d81f8e8096 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-duplicate-keys.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-duplicate-keys.md @@ -39,9 +39,7 @@ npm install --save-dev @babel/plugin-transform-duplicate-keys ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-exponentiation-operator.md b/website/versioned_docs/version-7.0.0/plugin-transform-exponentiation-operator.md index 8e392f5fcc..8a3679817c 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-exponentiation-operator.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-exponentiation-operator.md @@ -31,9 +31,7 @@ npm install --save-dev @babel/plugin-transform-exponentiation-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-flow-comments.md b/website/versioned_docs/version-7.0.0/plugin-transform-flow-comments.md index c481c6408e..9c6c974a97 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-flow-comments.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-flow-comments.md @@ -49,9 +49,7 @@ npm install --save-dev @babel/plugin-transform-flow-comments ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-flow-strip-types.md b/website/versioned_docs/version-7.0.0/plugin-transform-flow-strip-types.md index c8c660ab4a..3b345631d7 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-flow-strip-types.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-flow-strip-types.md @@ -27,9 +27,7 @@ npm install --save-dev @babel/plugin-transform-flow-strip-types ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-for-of.md b/website/versioned_docs/version-7.0.0/plugin-transform-for-of.md index 0c789606d5..8499f309b0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-for-of.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-for-of.md @@ -48,9 +48,7 @@ npm install --save-dev @babel/plugin-transform-for-of ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-function-name.md b/website/versioned_docs/version-7.0.0/plugin-transform-function-name.md index da779f814f..fae003cbf6 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-function-name.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-function-name.md @@ -29,9 +29,7 @@ npm install --save-dev @babel/plugin-transform-function-name ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-inline-consecutive-adds.md b/website/versioned_docs/version-7.0.0/plugin-transform-inline-consecutive-adds.md index d7df6e9543..438b8ea9ed 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-inline-consecutive-adds.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-inline-consecutive-adds.md @@ -44,9 +44,7 @@ npm install babel-plugin-transform-inline-consecutive-adds --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-inline-environment-variables.md b/website/versioned_docs/version-7.0.0/plugin-transform-inline-environment-variables.md index 4ac940eba0..71ffa51b07 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-inline-environment-variables.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-inline-environment-variables.md @@ -28,9 +28,7 @@ npm install babel-plugin-transform-inline-environment-variables --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-instanceof.md b/website/versioned_docs/version-7.0.0/plugin-transform-instanceof.md index 15704a1a5d..5a70b34e20 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-instanceof.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-instanceof.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-transform-instanceof ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-jscript.md b/website/versioned_docs/version-7.0.0/plugin-transform-jscript.md index ccefe71b49..1c318504a9 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-jscript.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-jscript.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-transform-jscript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-literals.md b/website/versioned_docs/version-7.0.0/plugin-transform-literals.md index 25b2a0c272..d24da0067f 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-literals.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-literals.md @@ -31,9 +31,7 @@ npm install --save-dev @babel/plugin-transform-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-member-expression-literals.md b/website/versioned_docs/version-7.0.0/plugin-transform-member-expression-literals.md index f466d10a8c..9b240ff4b5 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-member-expression-literals.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-member-expression-literals.md @@ -33,9 +33,7 @@ npm install @babel/plugin-transform-member-expression-literals --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-merge-sibling-variables.md b/website/versioned_docs/version-7.0.0/plugin-transform-merge-sibling-variables.md index 5076a42db4..b9bae29718 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-merge-sibling-variables.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-merge-sibling-variables.md @@ -38,9 +38,7 @@ npm install babel-plugin-transform-merge-sibling-variables --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-minify-booleans.md b/website/versioned_docs/version-7.0.0/plugin-transform-minify-booleans.md index 683cabb057..c4cf71cc58 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-minify-booleans.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-minify-booleans.md @@ -29,9 +29,7 @@ npm install babel-plugin-transform-minify-booleans --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-modules-amd.md b/website/versioned_docs/version-7.0.0/plugin-transform-modules-amd.md index 03da4181d9..c037eb3e50 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-modules-amd.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-modules-amd.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-transform-modules-amd ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-modules-commonjs.md b/website/versioned_docs/version-7.0.0/plugin-transform-modules-commonjs.md index 5450762a34..def55080b0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-modules-commonjs.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-modules-commonjs.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/plugin-transform-modules-commonjs ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```js // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-modules-systemjs.md b/website/versioned_docs/version-7.0.0/plugin-transform-modules-systemjs.md index 9e62a384e7..56434ca911 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-modules-systemjs.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-modules-systemjs.md @@ -36,9 +36,7 @@ npm install --save-dev @babel/plugin-transform-modules-systemjs ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-modules-umd.md b/website/versioned_docs/version-7.0.0/plugin-transform-modules-umd.md index 857969cab1..48bf9573e8 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-modules-umd.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-modules-umd.md @@ -47,9 +47,7 @@ npm install --save-dev @babel/plugin-transform-modules-umd ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-new-target.md b/website/versioned_docs/version-7.0.0/plugin-transform-new-target.md index 251df18890..a51f5d93a7 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-new-target.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-new-target.md @@ -82,9 +82,7 @@ npm install --save-dev @babel/plugin-transform-new-target ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-node-env-inline.md b/website/versioned_docs/version-7.0.0/plugin-transform-node-env-inline.md index dcb34d27a3..cd3b379acf 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-node-env-inline.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-node-env-inline.md @@ -34,9 +34,7 @@ npm install babel-plugin-transform-node-env-inline --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-object-assign.md b/website/versioned_docs/version-7.0.0/plugin-transform-object-assign.md index 0009629309..a5e45d1034 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-object-assign.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-object-assign.md @@ -38,9 +38,7 @@ npm install --save-dev @babel/plugin-transform-object-assign ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-object-set-prototype-of-to-assign.md b/website/versioned_docs/version-7.0.0/plugin-transform-object-set-prototype-of-to-assign.md index 13badbf1bb..88eb1057ce 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-object-set-prototype-of-to-assign.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-object-set-prototype-of-to-assign.md @@ -31,9 +31,7 @@ npm install --save-dev @babel/plugin-transform-object-set-prototype-of-to-assign ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-object-super.md b/website/versioned_docs/version-7.0.0/plugin-transform-object-super.md index 9900ff6160..72194e2105 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-object-super.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-object-super.md @@ -51,9 +51,7 @@ npm install --save-dev @babel/plugin-transform-object-super ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-parameters.md b/website/versioned_docs/version-7.0.0/plugin-transform-parameters.md index 2fe3880b01..b384efde72 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-parameters.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-parameters.md @@ -59,9 +59,7 @@ not supported in your environment then you'll need the ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-property-literals.md b/website/versioned_docs/version-7.0.0/plugin-transform-property-literals.md index 487977ddbb..8c38808321 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-property-literals.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-property-literals.md @@ -43,9 +43,7 @@ npm install @babel/plugin-transform-property-literals --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-property-mutators.md b/website/versioned_docs/version-7.0.0/plugin-transform-property-mutators.md index a453013d96..a70063786e 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-property-mutators.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-property-mutators.md @@ -45,9 +45,7 @@ npm install --save-dev @babel/plugin-transform-property-mutators ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-proto-to-assign.md b/website/versioned_docs/version-7.0.0/plugin-transform-proto-to-assign.md index 540c2f39d9..d42f717b02 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-proto-to-assign.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-proto-to-assign.md @@ -54,9 +54,7 @@ npm install --save-dev @babel/plugin-transform-proto-to-assign ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-constant-elements.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-constant-elements.md index 5477fbcca3..88b354e17c 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-constant-elements.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-constant-elements.md @@ -59,9 +59,7 @@ npm install --save-dev @babel/plugin-transform-react-constant-elements ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-display-name.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-display-name.md index 893805aceb..a7af3b3682 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-display-name.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-display-name.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/plugin-transform-react-display-name ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-inline-elements.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-inline-elements.md index 91eabcc0bf..42f680bdc5 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-inline-elements.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-inline-elements.md @@ -56,9 +56,7 @@ npm install --save-dev @babel/plugin-transform-react-inline-elements ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-compat.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-compat.md index a55f8ecc65..ca8e13ceb0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-compat.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-compat.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/plugin-transform-react-jsx-compat ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-self.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-self.md index 402a732b16..c3e6ddc143 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-self.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-self.md @@ -27,9 +27,7 @@ npm install --save-dev @babel/plugin-transform-react-jsx-self ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-source.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-source.md index 3cfa88c7eb..066a56a895 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-source.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx-source.md @@ -27,9 +27,7 @@ npm install --save-dev @babel/plugin-transform-react-jsx-source ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx.md b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx.md index 939c959d73..f665ca4ade 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-react-jsx.md @@ -131,9 +131,7 @@ npm install --save-dev @babel/plugin-transform-react-jsx ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-regenerator.md b/website/versioned_docs/version-7.0.0/plugin-transform-regenerator.md index 71b1ea888a..403d923f51 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-regenerator.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-regenerator.md @@ -45,7 +45,7 @@ npm install --save-dev @babel/plugin-transform-regenerator ## Usage -### Via `.babelrc` (Recommended) +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-regexp-constructors.md b/website/versioned_docs/version-7.0.0/plugin-transform-regexp-constructors.md index d4dc161b26..a6b05f3ff3 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-regexp-constructors.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-regexp-constructors.md @@ -29,9 +29,7 @@ npm install babel-plugin-transform-regexp-constructors --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-remove-console.md b/website/versioned_docs/version-7.0.0/plugin-transform-remove-console.md index 0baae6caf8..23a020b88f 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-remove-console.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-remove-console.md @@ -27,9 +27,7 @@ npm install babel-plugin-transform-remove-console --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json // without options diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-remove-debugger.md b/website/versioned_docs/version-7.0.0/plugin-transform-remove-debugger.md index 4766d6068d..dc74ab7d0b 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-remove-debugger.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-remove-debugger.md @@ -26,9 +26,7 @@ npm install babel-plugin-transform-remove-debugger --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-remove-undefined.md b/website/versioned_docs/version-7.0.0/plugin-transform-remove-undefined.md index a919401762..c3788dc659 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-remove-undefined.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-remove-undefined.md @@ -37,9 +37,7 @@ npm install babel-plugin-transform-remove-undefined --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-reserved-words.md b/website/versioned_docs/version-7.0.0/plugin-transform-reserved-words.md index b42869bdcb..40caacb466 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-reserved-words.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-reserved-words.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/plugin-transform-reserved-words ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-runtime.md b/website/versioned_docs/version-7.0.0/plugin-transform-runtime.md index c56d74c4d9..4ed5768b67 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-runtime.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-runtime.md @@ -39,9 +39,7 @@ See the [technical details](#technical-details) section for more information on ## Usage -### Via `.babelrc` (Recommended) - -Add the following line to your `.babelrc` file: +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-shorthand-properties.md b/website/versioned_docs/version-7.0.0/plugin-transform-shorthand-properties.md index ce4936c852..c94ccf141a 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-shorthand-properties.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-shorthand-properties.md @@ -47,9 +47,7 @@ npm install --save-dev @babel/plugin-transform-shorthand-properties ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-simplify-comparison-operators.md b/website/versioned_docs/version-7.0.0/plugin-transform-simplify-comparison-operators.md index 1620f22dad..7624c944e9 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-simplify-comparison-operators.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-simplify-comparison-operators.md @@ -27,9 +27,7 @@ npm install babel-plugin-transform-simplify-comparison-operators --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-spread.md b/website/versioned_docs/version-7.0.0/plugin-transform-spread.md index f9fbfba62d..b5fc42b8f7 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-spread.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-spread.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-transform-spread ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-sticky-regex.md b/website/versioned_docs/version-7.0.0/plugin-transform-sticky-regex.md index b50dac522c..08d64cd9b0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-sticky-regex.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-sticky-regex.md @@ -27,9 +27,7 @@ npm install --save-dev @babel/plugin-transform-sticky-regex ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-strict-mode.md b/website/versioned_docs/version-7.0.0/plugin-transform-strict-mode.md index f7dfb341f1..4c059673c2 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-strict-mode.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-strict-mode.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/plugin-transform-strict-mode ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-template-literals.md b/website/versioned_docs/version-7.0.0/plugin-transform-template-literals.md index c9600038f8..8d1216d8f0 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-template-literals.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-template-literals.md @@ -27,9 +27,7 @@ npm install --save-dev @babel/plugin-transform-template-literals ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-typeof-symbol.md b/website/versioned_docs/version-7.0.0/plugin-transform-typeof-symbol.md index 3896fa850a..55fb7674ad 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-typeof-symbol.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-typeof-symbol.md @@ -31,9 +31,7 @@ npm install --save-dev @babel/plugin-transform-typeof-symbol ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-typescript.md b/website/versioned_docs/version-7.0.0/plugin-transform-typescript.md index 42158af984..6e2fcc23e8 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-typescript.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-typescript.md @@ -47,9 +47,7 @@ npm install --save-dev @babel/plugin-transform-typescript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-undefined-to-void.md b/website/versioned_docs/version-7.0.0/plugin-transform-undefined-to-void.md index 3968c4ebc4..008724c670 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-undefined-to-void.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-undefined-to-void.md @@ -29,9 +29,7 @@ npm install babel-plugin-transform-undefined-to-void --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/plugin-transform-unicode-regex.md b/website/versioned_docs/version-7.0.0/plugin-transform-unicode-regex.md index 94b4b8d3a7..60c5d20bb9 100644 --- a/website/versioned_docs/version-7.0.0/plugin-transform-unicode-regex.md +++ b/website/versioned_docs/version-7.0.0/plugin-transform-unicode-regex.md @@ -29,9 +29,7 @@ npm install --save-dev @babel/plugin-transform-unicode-regex ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-es2015.md b/website/versioned_docs/version-7.0.0/preset-es2015.md index 81bee1c279..2839237a65 100644 --- a/website/versioned_docs/version-7.0.0/preset-es2015.md +++ b/website/versioned_docs/version-7.0.0/preset-es2015.md @@ -16,9 +16,7 @@ npm install --save-dev @babel/preset-es2015 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-es2016.md b/website/versioned_docs/version-7.0.0/preset-es2016.md index fa98191637..13c8c059d6 100644 --- a/website/versioned_docs/version-7.0.0/preset-es2016.md +++ b/website/versioned_docs/version-7.0.0/preset-es2016.md @@ -16,9 +16,7 @@ npm install --save-dev @babel/preset-es2016 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-es2017.md b/website/versioned_docs/version-7.0.0/preset-es2017.md index 45dc007a1c..3a64737e28 100644 --- a/website/versioned_docs/version-7.0.0/preset-es2017.md +++ b/website/versioned_docs/version-7.0.0/preset-es2017.md @@ -16,9 +16,7 @@ npm install --save-dev @babel/preset-es2017 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-flow.md b/website/versioned_docs/version-7.0.0/preset-flow.md index 88ca839983..93c8f5a5b1 100644 --- a/website/versioned_docs/version-7.0.0/preset-flow.md +++ b/website/versioned_docs/version-7.0.0/preset-flow.md @@ -31,9 +31,7 @@ npm install --save-dev @babel/preset-flow ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-minify.md b/website/versioned_docs/version-7.0.0/preset-minify.md index 21bdf78b7a..87e6f85510 100644 --- a/website/versioned_docs/version-7.0.0/preset-minify.md +++ b/website/versioned_docs/version-7.0.0/preset-minify.md @@ -17,9 +17,7 @@ npm install babel-preset-minify --save-dev ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-react.md b/website/versioned_docs/version-7.0.0/preset-react.md index 4fdeaa08be..92c97d7982 100644 --- a/website/versioned_docs/version-7.0.0/preset-react.md +++ b/website/versioned_docs/version-7.0.0/preset-react.md @@ -28,9 +28,7 @@ npm install --save-dev @babel/preset-react ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.0.0/preset-stage-0.md b/website/versioned_docs/version-7.0.0/preset-stage-0.md index 7a219b8be9..9b04fc3bbb 100644 --- a/website/versioned_docs/version-7.0.0/preset-stage-0.md +++ b/website/versioned_docs/version-7.0.0/preset-stage-0.md @@ -18,9 +18,7 @@ npm install --save-dev @babel/preset-stage-0 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-stage-1.md b/website/versioned_docs/version-7.0.0/preset-stage-1.md index b53a1b3085..9cda80e127 100644 --- a/website/versioned_docs/version-7.0.0/preset-stage-1.md +++ b/website/versioned_docs/version-7.0.0/preset-stage-1.md @@ -28,9 +28,7 @@ npm install --save-dev @babel/preset-stage-1 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-stage-2.md b/website/versioned_docs/version-7.0.0/preset-stage-2.md index fcf1cafb9a..4e98510c56 100644 --- a/website/versioned_docs/version-7.0.0/preset-stage-2.md +++ b/website/versioned_docs/version-7.0.0/preset-stage-2.md @@ -28,9 +28,7 @@ npm install --save-dev @babel/preset-stage-2 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-stage-3.md b/website/versioned_docs/version-7.0.0/preset-stage-3.md index c55af88199..7bc37b6692 100644 --- a/website/versioned_docs/version-7.0.0/preset-stage-3.md +++ b/website/versioned_docs/version-7.0.0/preset-stage-3.md @@ -28,9 +28,7 @@ npm install --save-dev @babel/preset-stage-3 ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.0.0/preset-typescript.md b/website/versioned_docs/version-7.0.0/preset-typescript.md index a01bbfef97..287e4d0dbd 100644 --- a/website/versioned_docs/version-7.0.0/preset-typescript.md +++ b/website/versioned_docs/version-7.0.0/preset-typescript.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/preset-typescript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.2.0/plugin-proposal-decorators.md b/website/versioned_docs/version-7.2.0/plugin-proposal-decorators.md index 2b458af735..f4d983b1d8 100644 --- a/website/versioned_docs/version-7.2.0/plugin-proposal-decorators.md +++ b/website/versioned_docs/version-7.2.0/plugin-proposal-decorators.md @@ -57,7 +57,7 @@ npm install --save-dev @babel/plugin-proposal-decorators ## Usage -Add the following line to your .babelrc file: +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.2.0/plugin-proposal-private-methods.md b/website/versioned_docs/version-7.2.0/plugin-proposal-private-methods.md index bece3f74cc..5afc342f45 100644 --- a/website/versioned_docs/version-7.2.0/plugin-proposal-private-methods.md +++ b/website/versioned_docs/version-7.2.0/plugin-proposal-private-methods.md @@ -27,9 +27,7 @@ $ npm install @babel/plugin-proposal-private-methods ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.3.0/plugin-proposal-pipeline-operator.md b/website/versioned_docs/version-7.3.0/plugin-proposal-pipeline-operator.md index b5727da1d3..14f229f53c 100644 --- a/website/versioned_docs/version-7.3.0/plugin-proposal-pipeline-operator.md +++ b/website/versioned_docs/version-7.3.0/plugin-proposal-pipeline-operator.md @@ -13,9 +13,7 @@ $ npm install --save-dev @babel/plugin-proposal-pipeline-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.3.0/plugin-proposal-private-methods.md b/website/versioned_docs/version-7.3.0/plugin-proposal-private-methods.md index 7692da8c9c..809933f5fb 100644 --- a/website/versioned_docs/version-7.3.0/plugin-proposal-private-methods.md +++ b/website/versioned_docs/version-7.3.0/plugin-proposal-private-methods.md @@ -32,9 +32,7 @@ $ npm install @babel/plugin-proposal-private-methods ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.3.0/plugin-transform-named-capturing-groups-regex.md b/website/versioned_docs/version-7.3.0/plugin-transform-named-capturing-groups-regex.md index fedca68d53..79d218e78d 100644 --- a/website/versioned_docs/version-7.3.0/plugin-transform-named-capturing-groups-regex.md +++ b/website/versioned_docs/version-7.3.0/plugin-transform-named-capturing-groups-regex.md @@ -35,9 +35,7 @@ npm install --save-dev @babel/plugin-transform-named-capturing-groups-regex ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.4.0/plugin-proposal-partial-application.md b/website/versioned_docs/version-7.4.0/plugin-proposal-partial-application.md index fd90d4d09a..47fb640eb1 100644 --- a/website/versioned_docs/version-7.4.0/plugin-proposal-partial-application.md +++ b/website/versioned_docs/version-7.4.0/plugin-proposal-partial-application.md @@ -53,7 +53,7 @@ $ npm install --save-dev @babel/plugin-proposal-partial-application ## Usage -Add the following line to your .babelrc file: +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.4.0/plugin-syntax-dynamic-import.md b/website/versioned_docs/version-7.4.0/plugin-syntax-dynamic-import.md index 3f1c463213..f5e011ab1d 100644 --- a/website/versioned_docs/version-7.4.0/plugin-syntax-dynamic-import.md +++ b/website/versioned_docs/version-7.4.0/plugin-syntax-dynamic-import.md @@ -13,9 +13,7 @@ npm install --save-dev @babel/plugin-syntax-dynamic-import ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.4.0/plugin-syntax-partial-application.md b/website/versioned_docs/version-7.4.0/plugin-syntax-partial-application.md index 19336d8dc2..d2c252b88c 100644 --- a/website/versioned_docs/version-7.4.0/plugin-syntax-partial-application.md +++ b/website/versioned_docs/version-7.4.0/plugin-syntax-partial-application.md @@ -17,9 +17,7 @@ npm install --save-dev @babel/plugin-syntax-partial-application ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.4.0/plugin-transform-runtime.md b/website/versioned_docs/version-7.4.0/plugin-transform-runtime.md index fc50474ef2..dd620c30c9 100644 --- a/website/versioned_docs/version-7.4.0/plugin-transform-runtime.md +++ b/website/versioned_docs/version-7.4.0/plugin-transform-runtime.md @@ -39,9 +39,7 @@ See the [technical details](#technical-details) section for more information on ## Usage -### Via `.babelrc` (Recommended) - -Add the following line to your `.babelrc` file: +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.5.0/plugin-proposal-pipeline-operator.md b/website/versioned_docs/version-7.5.0/plugin-proposal-pipeline-operator.md index 245d8a5c89..b78d143ba2 100644 --- a/website/versioned_docs/version-7.5.0/plugin-proposal-pipeline-operator.md +++ b/website/versioned_docs/version-7.5.0/plugin-proposal-pipeline-operator.md @@ -13,9 +13,7 @@ $ npm install --save-dev @babel/plugin-proposal-pipeline-operator ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.5.0/plugin-transform-typescript.md b/website/versioned_docs/version-7.5.0/plugin-transform-typescript.md index 0cf9e17c9c..7a34b00e25 100644 --- a/website/versioned_docs/version-7.5.0/plugin-transform-typescript.md +++ b/website/versioned_docs/version-7.5.0/plugin-transform-typescript.md @@ -29,9 +29,7 @@ npm install --save-dev @babel/plugin-transform-typescript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.6.0/preset-typescript.md b/website/versioned_docs/version-7.6.0/preset-typescript.md index b37ca4f6d2..297d6ffdcc 100644 --- a/website/versioned_docs/version-7.6.0/preset-typescript.md +++ b/website/versioned_docs/version-7.6.0/preset-typescript.md @@ -33,9 +33,7 @@ npm install --save-dev @babel/preset-typescript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.7.0/plugin-syntax-top-level-await.md b/website/versioned_docs/version-7.7.0/plugin-syntax-top-level-await.md index 9db6c70d42..68e5939ef5 100644 --- a/website/versioned_docs/version-7.7.0/plugin-syntax-top-level-await.md +++ b/website/versioned_docs/version-7.7.0/plugin-syntax-top-level-await.md @@ -25,9 +25,7 @@ npm install --save-dev @babel/plugin-syntax-top-level-await ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.7.0/plugin-transform-react-jsx.md b/website/versioned_docs/version-7.7.0/plugin-transform-react-jsx.md index f7f404f2b7..db001d2c77 100644 --- a/website/versioned_docs/version-7.7.0/plugin-transform-react-jsx.md +++ b/website/versioned_docs/version-7.7.0/plugin-transform-react-jsx.md @@ -131,9 +131,7 @@ npm install --save-dev @babel/plugin-transform-react-jsx ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.7.0/plugin-transform-typescript.md b/website/versioned_docs/version-7.7.0/plugin-transform-typescript.md index d1c557b230..32966fc30f 100644 --- a/website/versioned_docs/version-7.7.0/plugin-transform-typescript.md +++ b/website/versioned_docs/version-7.7.0/plugin-transform-typescript.md @@ -29,9 +29,7 @@ npm install --save-dev @babel/plugin-transform-typescript ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) ```json { diff --git a/website/versioned_docs/version-7.7.0/preset-react.md b/website/versioned_docs/version-7.7.0/preset-react.md index fa4a7396ac..20e4efd9ed 100644 --- a/website/versioned_docs/version-7.7.0/preset-react.md +++ b/website/versioned_docs/version-7.7.0/preset-react.md @@ -28,9 +28,7 @@ npm install --save-dev @babel/preset-react ## Usage -### Via `.babelrc` (Recommended) - -**.babelrc** +### With a configuration file (Recommended) Without options: diff --git a/website/versioned_docs/version-7.8.0/plugin-external-helpers.md b/website/versioned_docs/version-7.8.0/plugin-external-helpers.md deleted file mode 100644 index 5b711894ee..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-external-helpers.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-external-helpers -title: @babel/plugin-external-helpers -sidebar_label: external-helpers -original_id: babel-plugin-external-helpers ---- - -```sh -npm install --save-dev @babel/plugin-external-helpers -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-external-helpers"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-external-helpers script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-external-helpers"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-constant-folding.md b/website/versioned_docs/version-7.8.0/plugin-minify-constant-folding.md deleted file mode 100644 index 881b763a9c..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-constant-folding.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-constant-folding -title: babel-plugin-minify-constant-folding -sidebar_label: minify-constant-folding -original_id: babel-plugin-minify-constant-folding ---- - -## Example - -**In** - -```javascript -"a" + "b" -2 * 3; -4 | 3; -"b" + a + "c" + "d" + g + z + "f" + "h" + "i" - -[a, b, c].concat([d, e], f, g, [h]); -["a", "b", "c"].join(); -["a", "b", "c"].join('@'); -[1, 2, 3].length; -[1, 2, 3][1]; -[1, 2, 3].shift(); -[1, 2, 3].slice(0, 2); -[a, b, c].pop(); -[a, b, c].reverse(); -"a,b,c".split(","); -"abc"[0]; -"abc".charAt(); -"abc".charAt(1); -"abc".length; -``` - -**Out** - -```javascript -"ab"; -6; -7; -"b" + a + "cd" + g + z + "fhi"; - -[a, b, c, d, e, f, g, h]; -"a,b,c"; -"a@b@c"; -3; -2; -2; -[1, 2]; -c; -[c, b, a]; -["a", "b", "c"]; -"a"; -"a"; -"a"; -"b"; -3; -``` - -## Installation - -```sh -npm install babel-plugin-minify-constant-folding --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-constant-folding"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-constant-folding script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-constant-folding"] -}); -``` - -## Options - -+ `tdz` - Account for TDZ (Temporal Dead Zone) - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-dead-code-elimination.md b/website/versioned_docs/version-7.8.0/plugin-minify-dead-code-elimination.md deleted file mode 100644 index e57ed90b2e..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-dead-code-elimination.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-dead-code-elimination -title: babel-plugin-minify-dead-code-elimination -sidebar_label: minify-dead-code-elimination -original_id: babel-plugin-minify-dead-code-elimination ---- - -## Example - -**In** - -```javascript -function foo() {var x = 1;} -function bar() { var x = f(); } -function baz() { - var x = 1; - console.log(x); - function unused() { - return 5; - } -} -``` - -**Out** - -```javascript -function foo() {} -function bar() { f(); } -function baz() { - console.log(1); -} -``` - -## Installation - -```sh -npm install babel-plugin-minify-dead-code-elimination --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -// without options -{ - "plugins": ["minify-dead-code-elimination"] -} - -// with options -{ - "plugins": ["minify-dead-code-elimination", { "optimizeRawSize": true }] -} -``` - -### Via CLI - -```sh -babel --plugins minify-dead-code-elimination script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-dead-code-elimination"] -}); -``` - -## Options - -+ `keepFnName` - prevent plugin from removing function name. Useful for code depending on `fn.name` -+ `keepFnArgs` - prevent plugin from removing function args. Useful for code depending on `fn.length` -+ `keepClassName` - prevent plugin from removing class name. Useful for code depending on `cls.name` -+ `tdz` - Account for TDZ (Temporal Dead Zone) - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-flip-comparisons.md b/website/versioned_docs/version-7.8.0/plugin-minify-flip-comparisons.md deleted file mode 100644 index 0df068476a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-flip-comparisons.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-flip-comparisons -title: babel-plugin-minify-flip-comparisons -sidebar_label: minify-flip-comparisons -original_id: babel-plugin-minify-flip-comparisons ---- - -## Example - -**In** - -```javascript -const foo = a === 1; -if (bar !== null) { - var baz = 0; -} -``` - -**Out** - -```javascript -const foo = 1 === a; -if (null !== bar) { - var baz = 0; -} -``` - -## Installation - -```sh -npm install babel-plugin-minify-flip-comparisons --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-flip-comparisons"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-flip-comparisons script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-flip-comparisons"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-guarded-expressions.md b/website/versioned_docs/version-7.8.0/plugin-minify-guarded-expressions.md deleted file mode 100644 index c794883a21..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-guarded-expressions.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-guarded-expressions -title: babel-plugin-minify-guarded-expressions -sidebar_label: minify-guarded-expressions -original_id: babel-plugin-minify-guarded-expressions ---- - -**In** - -```javascript -!x && foo(); -alert(0 && new Foo()); -``` - -**Out** - -```javascript -x || foo(); -alert(0); -``` - -## Installation - -```sh -npm install babel-plugin-minify-guarded-expressions --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-guarded-expressions"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-guarded-expressions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-guarded-expressions"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-infinity.md b/website/versioned_docs/version-7.8.0/plugin-minify-infinity.md deleted file mode 100644 index ad5774fad3..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-infinity.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-infinity -title: babel-plugin-minify-infinity -sidebar_label: minify-infinity -original_id: babel-plugin-minify-infinity ---- - -**In** - -```javascript -Infinity; -``` - -**Out** - -```javascript -1 / 0; -``` - -## Installation - -```sh -npm install babel-plugin-minify-infinity --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-infinity"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-infinity script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-infinity"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-mangle-names.md b/website/versioned_docs/version-7.8.0/plugin-minify-mangle-names.md deleted file mode 100644 index 86eb108bb9..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-mangle-names.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-mangle-names -title: babel-plugin-minify-mangle-names -sidebar_label: minify-mangle-names -original_id: babel-plugin-minify-mangle-names ---- - -## Example - -**In** - -```javascript -var globalVariableName = 42; -function foo() { - var longLocalVariableName = 1; - if (longLocalVariableName) { - console.log(longLocalVariableName); - } -} -``` - -**Out** - -```javascript -var globalVariableName = 42; -function foo() { - var a = 1; - if (a) { - console.log(a); - } -} -``` - -## Installation - -```sh -npm install babel-plugin-minify-mangle-names --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -// without options -{ - "plugins": ["minify-mangle-names"] -} -``` - -```json -// with options -{ - "plugins": [ - ["minify-mangle-names", { "exclude": { "foo": true, "bar": true} }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins minify-mangle-names script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-mangle-names"] -}); -``` - -## Options - -+ `exclude` - A plain JS Object with keys as identifier names and values indicating whether to exclude (default: `{}`) -+ `eval` - mangle identifiers in scopes accessible by eval (default: `false`) -+ `keepFnName` - prevent mangler from altering function names. Useful for code depending on `fn.name` (default: `false`) -+ `topLevel` - mangle topLevel Identifiers (default: `false`) -+ `keepClassName` - prevent mangler from altering class names (default: `false`). - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-numeric-literals.md b/website/versioned_docs/version-7.8.0/plugin-minify-numeric-literals.md deleted file mode 100644 index 6b7ad3e8ca..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-numeric-literals.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-numeric-literals -title: babel-plugin-minify-numeric-literals -sidebar_label: minify-numeric-literals -original_id: babel-plugin-minify-numeric-literals ---- - -## Example - -**In** - -```javascript -[1000, -20000] -``` - -**Out** - -```javascript -[1e3, -2e4] -``` - -## Installation - -```sh -npm install babel-plugin-minify-numeric-literals --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-numeric-literals"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-numeric-literals script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-numeric-literals"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-replace.md b/website/versioned_docs/version-7.8.0/plugin-minify-replace.md deleted file mode 100644 index fb3a945567..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-replace.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-replace -title: babel-plugin-minify-replace -sidebar_label: minify-replace -original_id: babel-plugin-minify-replace ---- - -## Example - -**Options** - -```javascript -[ - { - identifierName: "__DEV__", - replacement: { - type: "numericLiteral", - value: 0, - }, - }, -] -``` - -**In** - -```javascript -if (!__DEV__) { - foo(); -} -if (a.__DEV__) { - foo(); -} -``` - -**Out** - -```javascript -if (!0) { - foo(); -} -if (a.__DEV__) { - foo(); -} -``` - -## Installation - -```sh -npm install babel-plugin-minify-replace --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -// without options -{ - "plugins": ["minify-replace"] -} -``` - -```json -// with options -{ - "plugins": [ - ["minify-replace", { - "replacements": [{ - "identifierName": "__DEV__", - "replacement": { - "type": "booleanLiteral", - "value": true - } - }] - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins minify-replace script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-replace"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-simplify.md b/website/versioned_docs/version-7.8.0/plugin-minify-simplify.md deleted file mode 100644 index 8c1c8821d7..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-simplify.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-simplify -title: babel-plugin-minify-simplify -sidebar_label: minify-simplify -original_id: babel-plugin-minify-simplify ---- - -## Example - -### Reduce statement into expression - -**In** - -```js -function foo() { - if (x) a(); -} -function foo2() { - if (x) a(); - else b(); -} -``` - -**Out** - -```js -function foo() { - x && a(); -} -function foo2() { - x ? a() : b(); -} -``` - -### Make expression as uniform as possible for better compressibility - -**In** - -```js -undefined -foo['bar'] -Number(foo) -``` - -**Out** - -```js -void 0 -foo.bar -+foo -``` - - -## Installation - -```sh -npm install babel-plugin-minify-simplify --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-simplify"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-simplify script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-simplify"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-minify-type-constructors.md b/website/versioned_docs/version-7.8.0/plugin-minify-type-constructors.md deleted file mode 100644 index 51d210e3a7..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-minify-type-constructors.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-minify-type-constructors -title: babel-plugin-minify-type-constructors -sidebar_label: minify-type-constructors -original_id: babel-plugin-minify-type-constructors ---- - -## Example - -**In** - -```javascript -Boolean(x); -Number(x); -String(x); -Array(3); -Array(3,1); -Object({foo: 'bar'}); -``` - -**Out** - -```javascript -!!x; -+x; -x + ""; -[,,,]; -[3, 1]; -{foo: 'bar'}; -``` - -## Installation - -```sh -npm install babel-plugin-minify-type-constructors --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["minify-type-constructors"] -} -``` - -### Via CLI - -```sh -babel --plugins minify-type-constructors script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["minify-type-constructors"] -}); -``` - -## Options - -+ `array` - prevent plugin from minifying arrays -+ `boolean` - prevent plugin from minifying booleans -+ `number` — prevent plugin from minifying numbers -+ `object` — prevent plugin from minifying objects -+ `string` — prevent plugin from minifying strings - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-async-generator-functions.md b/website/versioned_docs/version-7.8.0/plugin-proposal-async-generator-functions.md deleted file mode 100644 index 20d5fdb94a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-async-generator-functions.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-async-generator-functions -title: @babel/plugin-proposal-async-generator-functions -sidebar_label: proposal-async-generator-functions -original_id: babel-plugin-proposal-async-generator-functions ---- - -## Example - -**In** - -```javascript -async function* agf() { - await 1; - yield 2; -} -``` - -**Out** - -```javascript -var _asyncGenerator = ... - -let agf = (() => { - var _ref = _asyncGenerator.wrap(function* () { - yield _asyncGenerator.await(1); - yield 2; - }); - - return function agf() { - return _ref.apply(this, arguments); - }; -})(); -``` - -For await example - -```js -async function f() { - for await (let x of y) { - g(x); - } -} -``` - -**Example Usage** - -```js -async function* genAnswers() { - var stream = [ Promise.resolve(4), Promise.resolve(9), Promise.resolve(12) ]; - var total = 0; - for await (let val of stream) { - total += await val; - yield total; - } -} - -function forEach(ai, fn) { - return ai.next().then(function (r) { - if (!r.done) { - fn(r); - return forEach(ai, fn); - } - }); -} - -var output = 0; -forEach(genAnswers(), function(val) { output += val.value }) -.then(function () { - console.log(output); // 42 -}); -``` - -[Try it Out in the REPL](https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=stage-3&code=async%20function*%20genAnswers()%20%7B%0A%20%20var%20stream%20%3D%20%5B%20Promise.resolve(4)%2C%20Promise.resolve(9)%2C%20Promise.resolve(12)%20%5D%3B%0A%20%20var%20total%20%3D%200%3B%0A%20%20for%20await%20(let%20val%20of%20stream)%20%7B%0A%20%20%20%20total%20%2B%3D%20await%20val%3B%0A%20%20%20%20yield%20total%3B%0A%20%20%7D%0A%7D%0A%0Afunction%20forEach(ai%2C%20fn)%20%7B%0A%20%20return%20ai.next().then(function%20(r)%20%7B%0A%20%20%20%20if%20(!r.done)%20%7B%0A%20%20%20%20%20%20fn(r)%3B%0A%20%20%20%20%20%20return%20forEach(ai%2C%20fn)%3B%0A%20%20%20%20%7D%0A%20%20%7D)%3B%0A%7D%0A%0Avar%20output%20%3D%200%3B%0AforEach(genAnswers()%2C%20function(val)%20%7B%20output%20%2B%3D%20val.value%20%7D)%0A.then(function%20()%20%7B%0A%20%20console.log(output)%3B%20%2F%2F%2042%0A%7D)%3B&experimental=true&loose=false&spec=false&playground=true&stage=0) - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-async-generator-functions -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-async-generator-functions"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-async-generator-functions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-async-generator-functions"] -}); -``` - -## References - -* [Proposal: Asynchronous iteration for ECMAScript](https://github.com/tc39/proposal-async-iteration) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-class-properties.md b/website/versioned_docs/version-7.8.0/plugin-proposal-class-properties.md deleted file mode 100644 index 60d16822d0..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-class-properties.md +++ /dev/null @@ -1,155 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-class-properties -title: @babel/plugin-proposal-class-properties -sidebar_label: proposal-class-properties -original_id: babel-plugin-proposal-class-properties ---- - -## Example - -Below is a class with four class properties which will be transformed. - -```js - class Bork { - //Property initializer syntax - instanceProperty = "bork"; - boundFunction = () => { - return this.instanceProperty; - }; - - //Static class properties - static staticProperty = "babelIsCool"; - static staticFunction = function() { - return Bork.staticProperty; - }; - } - - let myBork = new Bork; - - //Property initializers are not on the prototype. - console.log(myBork.__proto__.boundFunction); // > undefined - - //Bound functions are bound to the class instance. - console.log(myBork.boundFunction.call(undefined)); // > "bork" - - //Static function exists on the class. - console.log(Bork.staticFunction()); // > "babelIsCool" -``` - - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-class-properties -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-proposal-class-properties"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-proposal-class-properties", { "loose": true }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-class-properties script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-class-properties"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -When `true`, class properties are compiled to use an assignment expression instead of `Object.defineProperty`. - -For an explanation of the consequences of using either, see [Definition vs. Assignment](http://2ality.com/2012/08/property-definition-assignment.html) (TL;DR in Part 5) - -#### Example - -```js - class Bork { - static a = 'foo'; - static b; - - x = 'bar'; - y; - } -``` - -Without `{ "loose": true }`, the above code will compile to the following, using `Object.defineProperty`: - -```js -var Bork = function Bork() { - babelHelpers.classCallCheck(this, Bork); - Object.defineProperty(this, "x", { - configurable: true, - enumerable: true, - writable: true, - value: 'bar' - }); - Object.defineProperty(this, "y", { - configurable: true, - enumerable: true, - writable: true, - value: void 0 - }); -}; - -Object.defineProperty(Bork, "a", { - configurable: true, - enumerable: true, - writable: true, - value: 'foo' -}); -Object.defineProperty(Bork, "b", { - configurable: true, - enumerable: true, - writable: true, - value: void 0 -}); -``` - -However, with `{ "loose": true }`, it will compile using assignment expressions: - -```js -var Bork = function Bork() { - babelHelpers.classCallCheck(this, Bork); - this.x = 'bar'; - this.y = void 0; -}; - -Bork.a = 'foo'; -Bork.b = void 0; -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -* [Proposal: Public and private instance fields](https://github.com/tc39/proposal-class-fields) -* [Proposal: Static class features](https://github.com/tc39/proposal-static-class-features) diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-decorators.md b/website/versioned_docs/version-7.8.0/plugin-proposal-decorators.md deleted file mode 100644 index fdadc4a907..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-decorators.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-decorators -title: @babel/plugin-proposal-decorators -sidebar_label: proposal-decorators -original_id: babel-plugin-proposal-decorators ---- - -## Example - -(examples are from proposal) - -### Simple class decorator - -```js -@annotation -class MyClass { } - -function annotation(target) { - target.annotated = true; -} -``` - -### Class decorator - -```js -@isTestable(true) -class MyClass { } - -function isTestable(value) { - return function decorator(target) { - target.isTestable = value; - } -} -``` - -### Class function decorator - -```js -class C { - @enumerable(false) - method() { } -} - -function enumerable(value) { - return function (target, key, descriptor) { - descriptor.enumerable = value; - return descriptor; - } -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-decorators -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-decorators"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-decorators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-decorators"] -}); -``` - -## Options - -### `decoratorsBeforeExport` - -`boolean` - -```js -// decoratorsBeforeExport: false -export @decorator class Bar {} - -// decoratorsBeforeExport: true -@decorator -export class Foo {} -``` - -This option was added to help tc39 collect feedback from the community by allowing experimentation with both possible syntaxes. - -For more information, check out: [tc39/proposal-decorators#69](https://github.com/tc39/proposal-decorators/issues/69). - -### `legacy` - -`boolean`, defaults to `false`. - -Use the legacy (stage 1) decorators syntax and behavior. - -#### NOTE: Compatibility with `@babel/plugin-proposal-class-properties` - -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` mode, `@babel/plugin-proposal-class-properties` must be used in `loose` mode to support the `@babel/plugin-proposal-decorators`. - -Wrong: - -```json -{ - "plugins": [ - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-decorators" - ] -} -``` - -Right: - -```json -{ - "plugins": [ - "@babel/plugin-proposal-decorators", - "@babel/plugin-proposal-class-properties" - ] -} -``` - -```json -{ - "plugins": [ - ["@babel/plugin-proposal-decorators", { "legacy": true }], - ["@babel/plugin-proposal-class-properties", { "loose" : true }] - ] -} -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -* [Proposal: JavaScript Decorators](https://github.com/wycats/javascript-decorators/blob/master/README.md) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-export-default-from.md b/website/versioned_docs/version-7.8.0/plugin-proposal-export-default-from.md deleted file mode 100644 index 2ed3d11485..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-export-default-from.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-export-default-from -title: @babel/plugin-proposal-export-default-from -sidebar_label: proposal-export-default-from -original_id: babel-plugin-proposal-export-default-from ---- - -## Example - -```js -export v from 'mod'; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-export-default-from -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-export-default-from"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-export-default-from script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-export-default-from"] -}); -``` -## References - -* ~~[Proposal: Additional export-from statements in ES7](https://github.com/leebyron/ecmascript-more-export-from)~~ (Withdrawn) -* [ECMAScript Proposal: export default from](https://github.com/leebyron/ecmascript-export-default-from) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-export-namespace-from.md b/website/versioned_docs/version-7.8.0/plugin-proposal-export-namespace-from.md deleted file mode 100644 index 7ea1d1dacf..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-export-namespace-from.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-export-namespace-from -title: @babel/plugin-proposal-export-namespace-from -sidebar_label: proposal-export-namespace-from -original_id: babel-plugin-proposal-export-namespace-from ---- - -## Example - -```js -export * as ns from 'mod'; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-export-namespace-from -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-export-namespace-from"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-export-namespace-from script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-export-namespace-from"] -}); -``` -## References - -* ~~[Proposal: Additional export-from statements in ES7](https://github.com/leebyron/ecmascript-more-export-from)~~ (Withdrawn) -* [ECMAScript Proposal: export ns from](https://github.com/leebyron/ecmascript-export-ns-from) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-function-bind.md b/website/versioned_docs/version-7.8.0/plugin-proposal-function-bind.md deleted file mode 100644 index 836949677f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-function-bind.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-function-bind -title: @babel/plugin-proposal-function-bind -sidebar_label: proposal-function-bind -original_id: babel-plugin-proposal-function-bind ---- - -## Detail - -```js -obj::func -// is equivalent to: -func.bind(obj) - -::obj.func -// is equivalent to: -obj.func.bind(obj) - -obj::func(val) -// is equivalent to: -func.call(obj, val) - -::obj.func(val) -// is equivalent to: -obj.func.call(obj, val) -``` - - -## Example - -### Basic - -```js -const box = { - weight: 2, - getWeight() { return this.weight; }, -}; - -const { getWeight } = box; - -console.log(box.getWeight()); // prints '2' - -const bigBox = { weight: 10 }; -console.log(bigBox::getWeight()); // prints '10' - -// Can be chained: -function add(val) { return this + val; } - -console.log(bigBox::getWeight()::add(5)); // prints '15' -``` - - -### Using with `document.querySelectorAll` - -It can be very handy when used with `document.querySelectorAll`: - -```js -const { map, filter } = Array.prototype; - -let sslUrls = document.querySelectorAll('a') - ::map(node => node.href) - ::filter(href => href.substring(0, 5) === 'https'); - -console.log(sslUrls); -``` - - -`document.querySelectorAll` returns a `NodeList` element which is not a plain array, so you normally can't use the `map` function on it, and have to use it this way: `Array.prototype.map.call(document.querySelectorAll(...), node => { ... })`. The above code using the `::` will work because it is equivalent to: - -```js -const { map, filter } = Array.prototype; - -let sslUrls = document.querySelectorAll('a'); -sslUrls = map.call(sslUrls, node => node.href); -sslUrls = filter.call(sslUrls, href => href.substring(0, 5) === 'https'); - -console.log(sslUrls); -``` - -### Auto self binding -When nothing is specified before the `::` operator, the function is bound to its object: - -```js -$('.some-link').on('click', ::view.reset); -// is equivalent to: -$('.some-link').on('click', view.reset.bind(view)); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-function-bind -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-function-bind"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-function-bind script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-function-bind"] -}); -``` - -## References - -* [Proposal](https://github.com/zenparsing/es-function-bind) -* [Babel Blog: Function Bind Syntax](/blog/2015/05/14/function-bind) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-function-sent.md b/website/versioned_docs/version-7.8.0/plugin-proposal-function-sent.md deleted file mode 100644 index c0c8b28e05..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-function-sent.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-function-sent -title: @babel/plugin-proposal-function-sent -sidebar_label: proposal-function-sent -original_id: babel-plugin-proposal-function-sent ---- - -## Example - -```js -function* generator() { - console.log("Sent", function.sent); - console.log("Yield", yield); -} - -const iterator = generator(); -iterator.next(1); // Logs "Sent 1" -iterator.next(2); // Logs "Yield 2" -``` - -Is compiled roughly to - -```js -let generator = _skipFirstGeneratorNext(function* () { - const _functionSent = yield; - console.log("Sent", _functionSent); - console.log("Yield", yield); -}); - -const iterator = generator(); -iterator.next(1); // Logs "Sent 1" -iterator.next(2); // Logs "Yield 2" -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-function-sent -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-function-sent"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-function-sent script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-function-sent"] -}); -``` - -## References - -* [Proposal](https://github.com/allenwb/ESideas/blob/master/Generator%20metaproperty.md) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-json-strings.md b/website/versioned_docs/version-7.8.0/plugin-proposal-json-strings.md deleted file mode 100644 index 32afec0d28..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-json-strings.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-json-strings -title: @babel/plugin-proposal-json-strings -sidebar_label: proposal-json-strings -original_id: babel-plugin-proposal-json-strings ---- - -## Examples - -**In** - -```js -const ex = "before
after"; -// ^ There's a U+2028 char between 'before' and 'after' -``` - -**Out** - -```js -const ex = "before\u2028after"; -// ^ There's a U+2028 char between 'before' and 'after' -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-json-strings -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-json-strings"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-json-strings script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-json-strings"] -}); -``` - -## References -- [Proposal: Subsume JSON strings](https://github.com/babel/proposals/issues/43) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-logical-assignment-operators.md b/website/versioned_docs/version-7.8.0/plugin-proposal-logical-assignment-operators.md deleted file mode 100644 index c6a764bf80..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-logical-assignment-operators.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-logical-assignment-operators -title: @babel/plugin-proposal-logical-assignment-operators -sidebar_label: proposal-logical-assignment-operators -original_id: babel-plugin-proposal-logical-assignment-operators ---- - -## Example - -**In** - -```javascript -a ||= b; -obj.a.b ||= c; - -a &&= b; -obj.a.b &&= c; -``` - -**Out** - -```javascript -var _obj$a, _obj$a2; - -a || (a = b); -(_obj$a = obj.a).b || (_obj$a.b = c); - -a && (a = b); -(_obj$a2 = obj.a).b && (_obj$a2.b = c); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-logical-assignment-operators -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-logical-assignment-operators"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-logical-assignment-operators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-logical-assignment-operators"] -}); -``` - -## References - -* [Proposal: Logical Assignment Operators](https://github.com/tc39/proposal-logical-assignment) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-nullish-coalescing-operator.md b/website/versioned_docs/version-7.8.0/plugin-proposal-nullish-coalescing-operator.md deleted file mode 100644 index a735cd290c..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-nullish-coalescing-operator.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-nullish-coalescing-operator -title: @babel/plugin-proposal-nullish-coalescing-operator -sidebar_label: proposal-nullish-coalescing-operator -original_id: babel-plugin-proposal-nullish-coalescing-operator ---- - -## Example - -**In** - -```javascript -var foo = object.foo ?? "default"; -``` - -**Out** - -```javascript -var _object$foo; - -var foo = (_object$foo = object.foo) !== null && _object$foo !== void 0 ? _object$foo : "default"; -``` - -> **NOTE:** We cannot use `!= null` here because `document.all == null` and -> `document.all` has been deemed not "nullish". - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-nullish-coalescing-operator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-nullish-coalescing-operator"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-nullish-coalescing-operator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-nullish-coalescing-operator"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -When `true`, this transform will pretend `document.all` does not exist, -and perform loose equality checks with `null` instead of strict equality checks -against both `null` and `undefined`. - -#### Example - -**In** - -```javascript -var foo = object.foo ?? "default"; -``` - -**Out** - -```javascript -var _object$foo; - -var foo = (_object$foo = object.foo) != null ? _object$foo : "default"; -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -* [Proposal: Nullish Coalescing](https://github.com/tc39-transfer/proposal-nullish-coalescing) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-numeric-separator.md b/website/versioned_docs/version-7.8.0/plugin-proposal-numeric-separator.md deleted file mode 100644 index 6a6a2959b2..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-numeric-separator.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-numeric-separator -title: @babel/plugin-proposal-numeric-separator -sidebar_label: proposal-numeric-separator -original_id: babel-plugin-proposal-numeric-separator ---- - -## Example - -### Decimal Literals - -```js -let budget = 1_000_000_000_000; - -// What is the value of `budget`? It's 1 trillion! -// -// Let's confirm: -console.log(budget === 10 ** 12); // true -``` - -### Binary Literals - -```js -let nibbles = 0b1010_0001_1000_0101; - -// Is bit 7 on? It sure is! -// 0b1010_0001_1000_0101 -// ^ -// -// We can double check: -console.log(!!(nibbles & (1 << 7))); // true -``` - -### Hex Literal - -```js -// Messages are sent as 24 bit values, but should be -// treated as 3 distinct bytes: -let message = 0xa0_b0_c0; - -// What's the value of the upper most byte? It's A0, or 160. -// We can confirm that: -let a = (message >> 16) & 0xff; -console.log(a.toString(16), a); // a0, 160 - -// What's the value of the middle byte? It's B0, or 176. -// Let's just make sure... -let b = (message >> 8) & 0xff; -console.log(b.toString(16), b); // b0, 176 - -// What's the value of the lower most byte? It's C0, or 192. -// Again, let's prove that: -let c = message & 0xff; -console.log(c.toString(16), b); // c0, 192 -``` - -### Octal Literal - -_hand wave emoji_ - -Octals are great for permissions, but also look better when represented in `0o0000` form. No real benefit with separators here. - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-numeric-separator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-numeric-separator"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-numeric-separator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-numeric-separator"], -}); -``` - -## Additional Information - -If you need to further compile ES2015 Decimal, Binary, Hex and Octal number representations to their pre-ES2015 numeric literal form, add the [`"@babel/plugin-transform-literals"`](plugin-transform-literals.md) plugin: - -> `@babel/plugin-transform-literals` is already included in [@babel/preset-env](preset-env.md) and @babel/preset-es2015. - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-env"], - "plugins": ["@babel/plugin-proposal-numeric-separator"] -} -{ - "plugins": ["@babel/plugin-proposal-numeric-separator", "@babel/plugin-transform-literals"] -} -``` - -## References - -- [Proposal: Numeric Separators](https://github.com/samuelgoto/proposal-numeric-separator) diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-object-rest-spread.md b/website/versioned_docs/version-7.8.0/plugin-proposal-object-rest-spread.md deleted file mode 100644 index e7df868c2e..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-object-rest-spread.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-object-rest-spread -title: @babel/plugin-proposal-object-rest-spread -sidebar_label: proposal-object-rest-spread -original_id: babel-plugin-proposal-object-rest-spread ---- - -## Example - -### Rest Properties - -```js -let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; -console.log(x); // 1 -console.log(y); // 2 -console.log(z); // { a: 3, b: 4 } -``` - -### Spread Properties - -```js -let n = { x, y, ...z }; -console.log(n); // { x: 1, y: 2, a: 3, b: 4 } -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-object-rest-spread -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-object-rest-spread"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-object-rest-spread script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-object-rest-spread"] -}); -``` - -## Options - -By default, this plugin will produce spec compliant code by using Babel's `objectSpread` helper. - -### `loose` - -`boolean`, defaults to `false`. - -Enabling this option will use Babel's `extends` helper, which is basically the same as `Object.assign` (see `useBuiltIns` below to use it directly). - -:warning: Please keep in mind that even if they're almost equivalent, there's an important difference between spread and `Object.assign`: **spread _defines_ new properties, while `Object.assign()` _sets_ them**, so using this mode might produce unexpected results in some cases. - -For detailed information please check out [Spread VS. Object.assign](http://2ality.com/2016/10/rest-spread-properties.html#spreading-objects-versus-objectassign) and [Assigning VS. defining properties](http://exploringjs.com/es6/ch_oop-besides-classes.html#sec_assigning-vs-defining-properties). - - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Enabling this option will use `Object.assign` directly instead of the Babel's `extends` helper. - -##### Example - -**.babelrc** - -```json -{ - "plugins": [ - ["@babel/plugin-proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }] - ] -} -``` - -**In** - -```js -z = { x, ...y }; -``` - -**Out** - -```js -z = Object.assign({ x }, y); -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -* [Proposal: Object Rest/Spread Properties for ECMAScript](https://github.com/tc39/proposal-object-rest-spread) -* [Spec](https://tc39.github.io/proposal-object-rest-spread/) -* [Spread VS. Object.assign](http://2ality.com/2016/10/rest-spread-properties.html#spreading-objects-versus-objectassign) -* [Assigning VS. defining properties](http://exploringjs.com/es6/ch_oop-besides-classes.html#sec_assigning-vs-defining-properties) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-optional-catch-binding.md b/website/versioned_docs/version-7.8.0/plugin-proposal-optional-catch-binding.md deleted file mode 100644 index c1880e7c49..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-optional-catch-binding.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-optional-catch-binding -title: @babel/plugin-proposal-optional-catch-binding -sidebar_label: proposal-optional-catch-binding -original_id: babel-plugin-proposal-optional-catch-binding ---- - - -## Examples - -```js -try { - throw 0; -} catch { - doSomethingWhichDoesNotCareAboutTheValueThrown(); -} -``` - -```js -try { - throw 0; -} catch { - doSomethingWhichDoesNotCareAboutTheValueThrown(); -} finally { - doSomeCleanup(); -} -``` - - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-optional-catch-binding -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-optional-catch-binding"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-optional-catch-binding script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-optional-catch-binding"] -}); -``` - -## References -- [Proposal: Optional Catch Binding for ECMAScript](https://github.com/babel/proposals/issues/7) - diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-pipeline-operator.md b/website/versioned_docs/version-7.8.0/plugin-proposal-pipeline-operator.md deleted file mode 100644 index 226afd983c..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-pipeline-operator.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-pipeline-operator -title: @babel/plugin-proposal-pipeline-operator -sidebar_label: proposal-pipeline-operator -original_id: babel-plugin-proposal-pipeline-operator ---- - -## Installation - -```sh -$ npm install --save-dev @babel/plugin-proposal-pipeline-operator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": [["@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" }]] -} -``` - -The Pipeline Proposal is one of three competing implementations. Which implementation the plugin should use is configured with the `"proposal"` option. This option is required and should be one of: - -* `"minimal"` – [Minimal Pipeline](https://github.com/tc39/proposal-pipeline-operator/) -* `"smart"` - [Smart Pipeline](https://github.com/js-choi/proposal-smart-pipelines) -* `"fsharp"` - [F#-Style Pipeline](https://github.com/valtech-nyc/proposal-fsharp-pipelines) - -When one of the implementations is accepted, it will become the default and the `"proposal"` option will no longer be required. - -### Via CLI - -```sh -$ babel --plugins @babel/plugin-proposal-pipeline-operator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-pipeline-operator"] -}); -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-private-methods.md b/website/versioned_docs/version-7.8.0/plugin-proposal-private-methods.md deleted file mode 100644 index 500ea9f92d..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-private-methods.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-private-methods -title: @babel/plugin-proposal-private-methods -sidebar_label: proposal-private-methods -original_id: babel-plugin-proposal-private-methods ---- - -## Example - -```js -class Counter extends HTMLElement { - #xValue = 0; - - get #x() { return this.#xValue; } - set #x(value) { - this.#xValue = value; - window.requestAnimationFrame( - this.#render.bind(this)); - } - - #clicked() { - this.#x++; - } -} -``` - -## Installation - -```sh -$ npm install @babel/plugin-proposal-private-methods -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-proposal-private-methods"] -} -``` - -With options: - -```json -{ - "plugins": [["@babel/plugin-proposal-private-methods", { "loose": true }]] -} -``` - -### Via CLI - -```sh -$ babel --plugins @babel/plugin-proposal-private-methods script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-private-methods"], -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -> Note: The `loose` mode configuration setting _must_ be the same as [`@babel/proposal-class-properties`](plugin-proposal-class-properties.md). - -When true, private methods will be assigned directly on its parent -via `Object.defineProperty` rather than a `WeakSet`. This results in improved -performance and debugging (normal property access vs `.get()`) at the expense -of potentially leaking "privates" via things like `Object.getOwnPropertyNames`. - -Let's use the following as an example: - -```javascript -class Foo { - constructor() { - this.publicField = this.#privateMethod(); - } - - #privateMethod() { - return 42; - } -} -``` - -By default, this becomes: - -```javascript -var Foo = function Foo() { - "use strict"; - - babelHelpers.classCallCheck(this, Foo); - - _privateMethod.add(this); - - this.publicField = babelHelpers - .classPrivateMethodGet(this, _privateMethod, _privateMethod2) - .call(this); -}; - -var _privateMethod = new WeakSet(); - -var _privateMethod2 = function _privateMethod2() { - return 42; -}; -``` - -With `{ loose: true }`, it becomes: - -```javascript -var Foo = function Foo() { - "use strict"; - - babelHelpers.classCallCheck(this, Foo); - Object.defineProperty(this, _privateMethod, { - value: _privateMethod2, - }); - this.publicField = babelHelpers - .classPrivateFieldLooseBase(this, _privateMethod) - [_privateMethod](); -}; - -var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod"); - -var _privateMethod2 = function _privateMethod2() { - return 42; -}; -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -- [Proposal: Private methods and getter/setters for JavaScript classes](https://github.com/tc39/proposal-private-methods) diff --git a/website/versioned_docs/version-7.8.0/plugin-proposal-throw-expressions.md b/website/versioned_docs/version-7.8.0/plugin-proposal-throw-expressions.md deleted file mode 100644 index ef145b167f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-proposal-throw-expressions.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-proposal-throw-expressions -title: @babel/plugin-proposal-throw-expressions -sidebar_label: proposal-throw-expressions -original_id: babel-plugin-proposal-throw-expressions ---- - -## Example - -```js -function test(param = throw new Error('required!')) { - const test = param === true || throw new Error('Falsy!'); -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-proposal-throw-expressions -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-proposal-throw-expressions"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-proposal-throw-expressions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-proposal-throw-expressions"] -}); -``` - -## References - -* [Proposal: ECMAScript throw expressions](https://github.com/tc39/proposal-throw-expressions) - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-async-generators.md b/website/versioned_docs/version-7.8.0/plugin-syntax-async-generators.md deleted file mode 100644 index e000479360..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-async-generators.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-async-generators -title: @babel/plugin-syntax-async-generators -sidebar_label: syntax-async-generators -original_id: babel-plugin-syntax-async-generators ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-async-generators](plugin-proposal-async-generator-functions.md) to _both_ parse and transform this syntax. - -## Example - -**Syntax** - -```javascript -async function* agf() { - await 1; -} -``` - -```js -async function f() { - for await (let x of y) { - g(x); - } -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-async-generators -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-async-generators"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-async-generators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-async-generators"] -}); -``` - -## References - -* [Proposal: Asynchronous iteration for ECMAScript](https://github.com/tc39/proposal-async-iteration) - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-bigint.md b/website/versioned_docs/version-7.8.0/plugin-syntax-bigint.md deleted file mode 100644 index b37b3d1d8f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-bigint.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-bigint -title: @babel/plugin-syntax-bigint -sidebar_label: syntax-bigint -original_id: babel-plugin-syntax-bigint ---- - - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-bigint -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-bigint"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-bigint script.js -``` - -### Via Node API - -```javascript -require("babel-core").transform("code", { - plugins: ["@babel/plugin-syntax-bigint"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-class-properties.md b/website/versioned_docs/version-7.8.0/plugin-syntax-class-properties.md deleted file mode 100644 index 53c8b20513..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-class-properties.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-class-properties -title: @babel/plugin-syntax-class-properties -sidebar_label: syntax-class-properties -original_id: babel-plugin-syntax-class-properties ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-class-properties](plugin-proposal-class-properties.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-class-properties -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-class-properties"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-class-properties script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-class-properties"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-decorators.md b/website/versioned_docs/version-7.8.0/plugin-syntax-decorators.md deleted file mode 100644 index 272467c562..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-decorators.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-decorators -title: @babel/plugin-syntax-decorators -sidebar_label: syntax-decorators -original_id: babel-plugin-syntax-decorators ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-decorators](plugin-proposal-decorators.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-decorators -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-decorators"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-decorators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-decorators"] -}); -``` - -## Options - -### `legacy` - -`boolean`, defaults to `false`. - -Use the legacy (stage 1) decorators syntax. - -### `decoratorsBeforeExport` - -`boolean`, defaults to `false`. - -```js -// decoratorsBeforeExport: true -@decorator -export class Foo {} - -// decoratorsBeforeExport: false -export @decorator class Bar {} -``` - -This option was added to help tc39 collect feedback from the community by allowing experimentation with both possible syntaxes. - -For more information, check out: [tc39/proposal-decorators#69](https://github.com/tc39/proposal-decorators/issues/69) - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-do-expressions.md b/website/versioned_docs/version-7.8.0/plugin-syntax-do-expressions.md deleted file mode 100644 index ddf19c35d1..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-do-expressions.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-do-expressions -title: @babel/plugin-syntax-do-expressions -sidebar_label: syntax-do-expressions -original_id: babel-plugin-syntax-do-expressions ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-do-expressions](plugin-proposal-do-expressions.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-do-expressions -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-do-expressions"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-do-expressions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-do-expressions"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-dynamic-import.md b/website/versioned_docs/version-7.8.0/plugin-syntax-dynamic-import.md deleted file mode 100644 index d985052acb..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-dynamic-import.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-dynamic-import -title: @babel/plugin-syntax-dynamic-import -sidebar_label: syntax-dynamic-import -original_id: babel-plugin-syntax-dynamic-import ---- - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-dynamic-import -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-dynamic-import"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-dynamic-import script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-dynamic-import"], -}); -``` - -## Working with Webpack and @babel/preset-env - -Currently, `@babel/preset-env` is unaware that using `import()` with [Webpack relies on `Promise` internally](https://webpack.js.org/guides/code-splitting/#dynamic-imports). Environments which do not have builtin support for `Promise`, like Internet Explorer, will require both the `promise` and `iterator` polyfills be added manually. - -For example, with `core-js@3`: - -```js -// webpack config -const config = { - entry: [ - "core-js/modules/es.promise", - "core-js/modules/es.array.iterator", - path.resolve(__dirname, "src/main.js"), - ], - // ... -}; -``` - -or - -```js -// src/main.js -import "core-js/modules/es.promise"; -import "core-js/modules/es.array.iterator"; - -// ... -``` - -This is the same for `core-js@2`, except the imports paths are slightly different: - -```js -// webpack config -const config = { - entry: [ - "core-js/modules/es6.promise", - "core-js/modules/es6.array.iterator", - path.resolve(__dirname, "src/main.js"), - ], - // ... -}; -``` - -or - -```js -// src/main.js -import "core-js/modules/es6.promise"; -import "core-js/modules/es6.array.iterator"; - -// ... -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-export-default-from.md b/website/versioned_docs/version-7.8.0/plugin-syntax-export-default-from.md deleted file mode 100644 index 2c13a00c4b..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-export-default-from.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-export-default-from -title: @babel/plugin-syntax-export-default-from -sidebar_label: syntax-export-default-from -original_id: babel-plugin-syntax-export-default-from ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-export-default-from](plugin-proposal-export-default-from.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-export-default-from -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-export-default-from"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-export-default-from script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-export-default-from"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-export-namespace-from.md b/website/versioned_docs/version-7.8.0/plugin-syntax-export-namespace-from.md deleted file mode 100644 index 821c644b2d..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-export-namespace-from.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-export-namespace-from -title: @babel/plugin-syntax-export-namespace-from -sidebar_label: syntax-export-namespace-from -original_id: babel-plugin-syntax-export-namespace-from ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-export-namespace-from](plugin-proposal-export-namespace-from.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-export-namespace-from -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-export-namespace-from"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-export-namespace-from script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-export-namespace-from"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-flow.md b/website/versioned_docs/version-7.8.0/plugin-syntax-flow.md deleted file mode 100644 index e1e35ed575..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-flow.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-flow -title: @babel/plugin-syntax-flow -sidebar_label: syntax-flow -original_id: babel-plugin-syntax-flow ---- - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-flow -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-flow"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-flow script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-flow"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-function-bind.md b/website/versioned_docs/version-7.8.0/plugin-syntax-function-bind.md deleted file mode 100644 index c5de9d079c..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-function-bind.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-function-bind -title: @babel/plugin-syntax-function-bind -sidebar_label: syntax-function-bind -original_id: babel-plugin-syntax-function-bind ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-function-bind](plugin-proposal-function-bind.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-function-bind -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-function-bind"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-function-bind script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-function-bind"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-function-sent.md b/website/versioned_docs/version-7.8.0/plugin-syntax-function-sent.md deleted file mode 100644 index 34fb8e6dd3..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-function-sent.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-function-sent -title: @babel/plugin-syntax-function-sent -sidebar_label: syntax-function-sent -original_id: babel-plugin-syntax-function-sent ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-function-sent](plugin-proposal-function-sent.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-function-sent -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-function-sent"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-function-sent script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-function-sent"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-import-meta.md b/website/versioned_docs/version-7.8.0/plugin-syntax-import-meta.md deleted file mode 100644 index 64d0fc1db4..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-import-meta.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-import-meta -title: @babel/plugin-syntax-import-meta -sidebar_label: syntax-import-meta -original_id: babel-plugin-syntax-import-meta ---- - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-import-meta -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-import-meta"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-import-meta script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-import-meta"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-json-strings.md b/website/versioned_docs/version-7.8.0/plugin-syntax-json-strings.md deleted file mode 100644 index 0c0442b5b8..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-json-strings.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-json-strings -title: @babel/plugin-syntax-json-strings -sidebar_label: syntax-json-strings -original_id: babel-plugin-syntax-json-strings ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-json-strings](plugin-proposal-json-strings.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-json-strings -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-json-strings"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-json-strings script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-json-strings"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-jsx.md b/website/versioned_docs/version-7.8.0/plugin-syntax-jsx.md deleted file mode 100644 index af2d728a76..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-jsx.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-jsx -title: @babel/plugin-syntax-jsx -sidebar_label: syntax-jsx -original_id: babel-plugin-syntax-jsx ---- - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-jsx -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-jsx"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-jsx script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-jsx"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-logical-assignment-operators.md b/website/versioned_docs/version-7.8.0/plugin-syntax-logical-assignment-operators.md deleted file mode 100644 index 868532bf02..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-logical-assignment-operators.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-logical-assignment-operators -title: @babel/plugin-syntax-logical-assignment-operators -sidebar_label: syntax-logical-assignment-operators -original_id: babel-plugin-syntax-logical-assignment-operators ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-logical-assignment-operators](plugin-proposal-logical-assignment-operators.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-logical-assignment-operators -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-logical-assignment-operators"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-logical-assignment-operators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-logical-assignment-operators"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-nullish-coalescing-operator.md b/website/versioned_docs/version-7.8.0/plugin-syntax-nullish-coalescing-operator.md deleted file mode 100644 index beddae7291..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-nullish-coalescing-operator.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-nullish-coalescing-operator -title: @babel/plugin-syntax-nullish-coalescing-operator -sidebar_label: syntax-nullish-coalescing-operator -original_id: babel-plugin-syntax-nullish-coalescing-operator ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-nullish-coalescing-operator](plugin-proposal-nullish-coalescing-operator.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-nullish-coalescing-operator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-nullish-coalescing-operator"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-nullish-coalescing-operator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-nullish-coalescing-operator"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-numeric-separator.md b/website/versioned_docs/version-7.8.0/plugin-syntax-numeric-separator.md deleted file mode 100644 index 9d1a861a3d..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-numeric-separator.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-numeric-separator -title: @babel/plugin-syntax-numeric-separator -sidebar_label: syntax-numeric-separator -original_id: babel-plugin-syntax-numeric-separator ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-numeric-separator](plugin-proposal-numeric-separator.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-numeric-separator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-numeric-separator"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-numeric-separator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-numeric-separator"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-object-rest-spread.md b/website/versioned_docs/version-7.8.0/plugin-syntax-object-rest-spread.md deleted file mode 100644 index 5ba07422e8..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-object-rest-spread.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-object-rest-spread -title: @babel/plugin-syntax-object-rest-spread -sidebar_label: syntax-object-rest-spread -original_id: babel-plugin-syntax-object-rest-spread ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-object-rest-spread](plugin-proposal-object-rest-spread.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-object-rest-spread -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-object-rest-spread"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-object-rest-spread script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-object-rest-spread"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-optional-catch-binding.md b/website/versioned_docs/version-7.8.0/plugin-syntax-optional-catch-binding.md deleted file mode 100644 index ce2fe9bc2a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-optional-catch-binding.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-optional-catch-binding -title: @babel/plugin-syntax-optional-catch-binding -sidebar_label: syntax-optional-catch-binding -original_id: babel-plugin-syntax-optional-catch-binding ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-optional-catch-binding](plugin-proposal-optional-catch-binding.md) to _both_ parse and transform this syntax. - -## Example - -**Syntax** - -```javascript -try { - throw 0; -} catch { - doSomethingWhichDoesNotCareAboutTheValueThrown(); - console.log("Yay, code executes!"); -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-optional-catch-binding -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-optional-catch-binding"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-optional-catch-binding script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-optional-catch-binding"] -}); -``` - -## References - -* [Proposal: Optional Catch Binding for ECMAScript](https://github.com/babel/proposals/issues/7) - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-optional-chaining.md b/website/versioned_docs/version-7.8.0/plugin-syntax-optional-chaining.md deleted file mode 100644 index ba9a50aa58..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-optional-chaining.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-optional-chaining -title: @babel/plugin-syntax-optional-chaining -sidebar_label: syntax-optional-chaining -original_id: babel-plugin-syntax-optional-chaining ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-optional-chaining](plugin-proposal-optional-chaining.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-optional-chaining -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-optional-chaining"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-optional-chaining script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-optional-chaining"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-partial-application.md b/website/versioned_docs/version-7.8.0/plugin-syntax-partial-application.md deleted file mode 100644 index 4f45b32a8b..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-partial-application.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-partial-application -title: @babel/plugin-syntax-partial-application -sidebar_label: syntax-partial-application -original_id: babel-plugin-syntax-partial-application ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-partial-application](plugin-proposal-partial-application.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-partial-application -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-partial-application"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-partial-application script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-partial-application"] -}); -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-pipeline-operator.md b/website/versioned_docs/version-7.8.0/plugin-syntax-pipeline-operator.md deleted file mode 100644 index 9d88ce2a35..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-pipeline-operator.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-pipeline-operator -title: @babel/plugin-syntax-pipeline-operator -sidebar_label: syntax-pipeline-operator -original_id: babel-plugin-syntax-pipeline-operator ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-pipeline-operator](plugin-proposal-pipeline-operator.md) to _both_ parse and transform this syntax. - -## Installation - -```sh -$ npm install @babel/plugin-syntax-pipeline-operator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-pipeline-operator"] -} -``` - -### Via CLI - -```sh -$ babel --plugins @babel/plugin-syntax-pipeline-operator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-pipeline-operator"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-throw-expressions.md b/website/versioned_docs/version-7.8.0/plugin-syntax-throw-expressions.md deleted file mode 100644 index 841e35a70d..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-throw-expressions.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-throw-expressions -title: @babel/plugin-syntax-throw-expressions -sidebar_label: syntax-throw-expressions -original_id: babel-plugin-syntax-throw-expressions ---- - -> #### Syntax only -> -> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-throw-expressions](plugin-proposal-throw-expressions.md) to _both_ parse and transform this syntax. - -```js -function test(param = throw new Error('required!')) { - const test = param === true || throw new Error('Falsy!'); -} -``` - - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-throw-expressions -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-throw-expressions"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-throw-expressions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-throw-expressions"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-top-level-await.md b/website/versioned_docs/version-7.8.0/plugin-syntax-top-level-await.md deleted file mode 100644 index 33f4ca7586..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-top-level-await.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-top-level-await -title: @babel/plugin-syntax-top-level-await -sidebar_label: syntax-top-level-await -original_id: babel-plugin-syntax-top-level-await ---- - -> #### Syntax only -> -> This plugin only enables parsing of this feature. Babel doesn't support transforming -> top-level await, but you can use Rollup's `experimentalTopLevelAwait` or webpack@5's -> `experiments.topLevelAwait` options. - -```js -const val = await promise; - -export { val }; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-syntax-top-level-await -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-top-level-await"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-top-level-await script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform(code, { - plugins: ["@babel/plugin-syntax-top-level-await"], -}); -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-syntax-typescript.md b/website/versioned_docs/version-7.8.0/plugin-syntax-typescript.md deleted file mode 100644 index f821f47f6f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-syntax-typescript.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-syntax-typescript -title: @babel/plugin-syntax-typescript -sidebar_label: syntax-typescript -original_id: babel-plugin-syntax-typescript ---- - -```sh -npm install --save-dev @babel/plugin-syntax-typescript -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-syntax-typescript"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-syntax-typescript script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-syntax-typescript"] -}); -``` - -## Options - -### `isTSX` - -`boolean`, defaults to `false`. - -Forcibly enables `jsx` parsing. Otherwise angle brackets will be treated as typescript's legacy type assertion `var foo = bar;` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-arrow-functions.md b/website/versioned_docs/version-7.8.0/plugin-transform-arrow-functions.md deleted file mode 100644 index f0c06c0cb0..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-arrow-functions.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-arrow-functions -title: @babel/plugin-transform-arrow-functions -sidebar_label: transform-arrow-functions -original_id: babel-plugin-transform-arrow-functions ---- - -## Example - -**In** - -```javascript -var a = () => {}; -var a = (b) => b; - -const double = [1,2,3].map((num) => num * 2); -console.log(double); // [2,4,6] - -var bob = { - _name: "Bob", - _friends: ["Sally", "Tom"], - printFriends() { - this._friends.forEach(f => - console.log(this._name + " knows " + f)); - } -}; -console.log(bob.printFriends()); -``` - -**Out** - -```javascript -var a = function () {}; -var a = function (b) { - return b; -}; - -const double = [1, 2, 3].map(function (num) { - return num * 2; -}); -console.log(double); // [2,4,6] - -var bob = { - _name: "Bob", - _friends: ["Sally", "Tom"], - printFriends() { - var _this = this; - - this._friends.forEach(function (f) { - return console.log(_this._name + " knows " + f); - }); - } -}; -console.log(bob.printFriends()); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-arrow-functions -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-arrow-functions"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-arrow-functions", { "spec": true }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-arrow-functions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-arrow-functions"] -}); -``` - -## Options - -### `spec` - -`boolean`, defaults to `false`. - -

- Example - - Using spec mode with the above example produces: - - ```js - var _this = this; - - var a = function a() { - babelHelpers.newArrowCheck(this, _this); - }.bind(this); - var a = function a(b) { - babelHelpers.newArrowCheck(this, _this); - return b; - }.bind(this); - - const double = [1, 2, 3].map(function (num) { - babelHelpers.newArrowCheck(this, _this); - return num * 2; - }.bind(this)); - console.log(double); // [2,4,6] - - var bob = { - _name: "Bob", - _friends: ["Sally", "Tom"], - printFriends() { - var _this2 = this; - - this._friends.forEach(function (f) { - babelHelpers.newArrowCheck(this, _this2); - return console.log(this._name + " knows " + f); - }.bind(this)); - } - }; - console.log(bob.printFriends()); - ``` -

- -This option enables the following: - - - Wrap the generated function in `.bind(this)` and keeps uses of `this` inside - the function as-is, instead of using a renamed `this`. - - - Add a runtime check to ensure the functions are not instantiated. - - - Add names to arrow functions. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-async-to-generator.md b/website/versioned_docs/version-7.8.0/plugin-transform-async-to-generator.md deleted file mode 100644 index 998bd9a897..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-async-to-generator.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-async-to-generator -title: @babel/plugin-transform-async-to-generator -sidebar_label: transform-async-to-generator -original_id: babel-plugin-transform-async-to-generator ---- - -> In Babel 7, `transform-async-to-module-method` was merged into this plugin - -## Example - -**In** - -```javascript -async function foo() { - await bar(); -} -``` - -**Out** - -```javascript -var _asyncToGenerator = function (fn) { - ... -}; -var foo = _asyncToGenerator(function* () { - yield bar(); -}); -``` - -**Out with options** - -> Turn async functions into a Bluebird coroutine - -```javascript -var Bluebird = require("bluebird"); - -var foo = Bluebird.coroutine(function* () { - yield bar(); -}); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-async-to-generator -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-async-to-generator"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-async-to-generator", { - "module": "bluebird", - "method": "coroutine" - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-async-to-generator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-async-to-generator"] -}); -``` - -## References - -* [Proposal: Async Functions for ECMAScript](https://github.com/tc39/ecmascript-asyncawait) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-block-scoped-functions.md b/website/versioned_docs/version-7.8.0/plugin-transform-block-scoped-functions.md deleted file mode 100644 index c07c6fae28..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-block-scoped-functions.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-block-scoped-functions -title: @babel/plugin-transform-block-scoped-functions -sidebar_label: transform-block-scoped-functions -original_id: babel-plugin-transform-block-scoped-functions ---- - -## Examples - -**In** - -```javascript -{ - function name (n) { - return n; - } -} - -name("Steve"); -``` - -**Out** - -```javascript -{ - let name = function (n) { - return n; - }; -} -name("Steve"); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-block-scoped-functions -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-block-scoped-functions"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-block-scoped-functions script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-block-scoped-functions"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-block-scoping.md b/website/versioned_docs/version-7.8.0/plugin-transform-block-scoping.md deleted file mode 100644 index 529047d8c5..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-block-scoping.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-block-scoping -title: @babel/plugin-transform-block-scoping -sidebar_label: transform-block-scoping -original_id: babel-plugin-transform-block-scoping ---- - -## Examples - -**In** - -```javascript -{ - let a = 3 -} - -let a = 3 -``` - -**Out** - -```javascript -{ - var _a = 3; -} - -var a = 3; -``` - -## Constant checks - -This plugin also validates all `const` variables. -Reassignment of constants is a runtime error and it will insert the necessary error code for those. - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-block-scoping -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-block-scoping"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-block-scoping", { - "throwIfClosureRequired": true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-block-scoping script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-block-scoping"] -}); -``` - -## Options - -### `throwIfClosureRequired` -`boolean`, defaults to `false`. - -In cases such as the following it's impossible to rewrite let/const without adding an additional function and closure while transforming: - -```javascript -for (let i = 0; i < 5; i++) { - setTimeout(() => console.log(i), 1); -} -``` - -In extremely performance-sensitive code, this can be undesirable. If `"throwIfClosureRequired": true` is set, Babel throws when transforming these patterns instead of automatically adding an additional function. - -### `tdz` -`boolean`, defaults to `false`. - -By default this plugin will ignore the *temporal dead zone (TDZ)* for block-scoped variables. The following code will **not throw an error when transpiled with Babel, which is not spec compliant**: - -```javascript -i -let i; -``` - -If you need these errors you can tell Babel to try and find them by setting `"tdz": true` for this plugin. However, the current implementation might not get all edge cases right and its best to just avoid code like this in the first place. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-classes.md b/website/versioned_docs/version-7.8.0/plugin-transform-classes.md deleted file mode 100644 index a8b20a8e72..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-classes.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-classes -title: @babel/plugin-transform-classes -sidebar_label: transform-classes -original_id: babel-plugin-transform-classes ---- - -## Caveats - -When extending a native class (e.g., `class extends Array {}`), the super class -needs to be wrapped. This is needed to workaround two problems: -- Babel transpiles classes using `SuperClass.apply(/* ... */)`, but native - classes aren't callable and thus throw in this case. -- Some built-in functions (like `Array`) always return a new object. Instead of - returning it, Babel should treat it as the new `this`. - -The wrapper works on IE11 and every other browser with `Object.setPrototypeOf` or `__proto__` as fallback. -There is **NO IE <= 10 support**. If you need IE <= 10 it's recommended that you don't extend natives. - -Babel needs to statically know if you are extending a built-in class. For this reason, the "mixin pattern" doesn't work: - -```js -class Foo extends mixin(Array) {} - -function mixin(Super) { - return class extends Super { mix() {} }; -} -``` - -To workaround this limitation, you can add another class in the inheritance chain so that Babel can wrap the native class: - -```js -const ExtensibleArray = class extends Array {} - -class Foo extends mixin(ExtensibleArray) {} -``` - -## Examples - -**In** - -```javascript -class Test { - constructor(name) { - this.name = name; - } - - logger () { - console.log("Hello", this.name); - } -} -``` - -**Out** - -```javascript -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Test = function () { - function Test(name) { - _classCallCheck(this, Test); - - this.name = name; - } - - Test.prototype.logger = function logger() { - console.log("Hello", this.name); - }; - - return Test; -}(); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-classes -``` - -## Usage - -### With a configuration file (Recommended) - -```js -// without options -{ - "plugins": ["@babel/plugin-transform-classes"] -} - -// with options -{ - "plugins": [ - ["@babel/plugin-transform-classes", { - "loose": true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-classes script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-classes"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -#### Method enumerability - -Please note that in loose mode class methods **are** enumerable. This is not in line -with the spec and you may run into issues. - -#### Method assignment - -Under loose mode, methods are defined on the class prototype with simple assignments -instead of being defined. This can result in the following not working: - -```javascript -class Foo { - set bar() { - throw new Error("foo!"); - } -} - -class Bar extends Foo { - bar() { - // will throw an error when this method is defined - } -} -``` - -When `Bar.prototype.foo` is defined it triggers the setter on `Foo`. This is a -case that is very unlikely to appear in production code however it's something -to keep in mind. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-computed-properties.md b/website/versioned_docs/version-7.8.0/plugin-transform-computed-properties.md deleted file mode 100644 index 49d6f135c6..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-computed-properties.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-computed-properties -title: @babel/plugin-transform-computed-properties -sidebar_label: transform-computed-properties -original_id: babel-plugin-transform-computed-properties ---- - -## Example - -**In** - -```js -var obj = { - ["x" + foo]: "heh", - ["y" + bar]: "noo", - foo: "foo", - bar: "bar" -}; -``` - -**Out** - -```js -var _obj; - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -var obj = ( - _obj = {}, - _defineProperty(_obj, "x" + foo, "heh"), - _defineProperty(_obj, "y" + bar, "noo"), - _defineProperty(_obj, "foo", "foo"), - _defineProperty(_obj, "bar", "bar"), - _obj -); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-computed-properties -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-computed-properties"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-computed-properties", { - "loose": true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-computed-properties script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-computed-properties"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false` - -Just like method assignment in classes, in loose mode, computed property names -use simple assignments instead of being defined. This is unlikely to be an issue -in production code. - -#### Example - -***In*** - -```js -var obj = { - ["x" + foo]: "heh", - ["y" + bar]: "noo", - foo: "foo", - bar: "bar" -}; -``` - -***Out*** - -```js -var _obj; - -var obj = ( - _obj = {}, - _obj["x" + foo] = "heh", - _obj["y" + bar] = "noo", - _obj.foo = "foo", - _obj.bar = "bar", - _obj -); -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-destructuring.md b/website/versioned_docs/version-7.8.0/plugin-transform-destructuring.md deleted file mode 100644 index 9ee89aa234..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-destructuring.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-destructuring -title: @babel/plugin-transform-destructuring -sidebar_label: transform-destructuring -original_id: babel-plugin-transform-destructuring ---- - -## Examples - -**In** - -```javascript -let {x, y} = obj; - -let [a, b, ...rest] = arr; -``` - -**Out** - -```javascript -function _toArray(arr) { ... } - -let _obj = obj, - x = _obj.x, - y = _obj.y; - -let _arr = arr, - _arr2 = _toArray(_arr), - a = _arr2[0], - b = _arr2[1], - rest = _arr2.slice(2); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-destructuring -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-destructuring"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-destructuring script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-destructuring"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -Enabling this option will assume that what you want to destructure is an array and won't use `Array.from` on other iterables. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Enabling this option will use `Object.assign` directly instead of the Babel's `extends` helper. - -##### Example - -**.babelrc** - -```json -{ - "plugins": [ - ["@babel/plugin-transform-destructuring", { "useBuiltIns": true }] - ] -} -``` - -**In** - -```js -var { ...x } = z; -``` - -**Out** - -```js -var _z = z, - x = Object.assign({}, _z); -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -* [MDN: Destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-duplicate-keys.md b/website/versioned_docs/version-7.8.0/plugin-transform-duplicate-keys.md deleted file mode 100644 index 502c1cee51..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-duplicate-keys.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-duplicate-keys -title: @babel/plugin-transform-duplicate-keys -sidebar_label: transform-duplicate-keys -original_id: babel-plugin-transform-duplicate-keys ---- - -This plugin actually converts duplicate keys in objects to be computed properties, which then must be handled by the [@babel/plugin-transform-computed-properties](plugin-transform-computed-properties.md) plugin. The final result won't contain any object literals with duplicate keys. - -## Example - -**In** - -```javascript -var x = { a: 5, a: 6 }; -var y = { - get a() {}, - set a(x) {}, - a: 3, -}; -``` - -**Out** - -```javascript -var x = { a: 5, ["a"]: 6 }; -var y = { - get a() {}, - set a(x) {}, - ["a"]: 3, -}; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-duplicate-keys -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-duplicate-keys"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-duplicate-keys script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-duplicate-keys"], -}); -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-exponentiation-operator.md b/website/versioned_docs/version-7.8.0/plugin-transform-exponentiation-operator.md deleted file mode 100644 index b67b10b03a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-exponentiation-operator.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-exponentiation-operator -title: @babel/plugin-transform-exponentiation-operator -sidebar_label: transform-exponentiation-operator -original_id: babel-plugin-transform-exponentiation-operator ---- - -## Example - -**In** - -```javascript -let x = 10 ** 2; - -x **= 3; -``` - -**Out** - -```javascript -let x = Math.pow(10, 2); - -x = Math.pow(x, 3); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-exponentiation-operator -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-exponentiation-operator"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-exponentiation-operator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-exponentiation-operator"] -}); -``` - -## References - -* [Spec: Exponentiation Operator](https://tc39.github.io/ecma262/#sec-exp-operator) -* [Proposal: Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-flow-comments.md b/website/versioned_docs/version-7.8.0/plugin-transform-flow-comments.md deleted file mode 100644 index 6d6ffdaa63..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-flow-comments.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-flow-comments -title: @babel/plugin-transform-flow-comments -sidebar_label: transform-flow-comments -original_id: babel-plugin-transform-flow-comments ---- - -You should be able to use this plugin instead of `@babel/plugin-flow-strip-types` to preserve the `/* @flow */` directive and still use flow. - -[Flow Comments Blog Post](https://flow.org/blog/2015/02/20/Flow-Comments.html) - -## Example - -**In** - -```javascript -function foo(bar?) {} -function foo2(bar?: string) {} -function foo(x: number): string {} -type B = { - name: string; -}; -export type GraphQLFormattedError = number; -import type A, { B, C } from './types'; -import typeof D, { E, F } from './types'; -``` - -**Out** - -```javascript -"use strict"; - -function foo(bar /*:: ?*/) {} -function foo2(bar /*:: ?: string*/) {} -function foo(x /*: number*/) /*: string*/ {} -/*:: type B = { - name: string; -};*/ -/*:: export type GraphQLFormattedError = number;*/ -/*:: import type A, { B, C } from './types';*/ -/*:: import typeof D, { E, F } from './types';*/ -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-flow-comments -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-flow-comments"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-flow-comments script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-flow-comments"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-flow-strip-types.md b/website/versioned_docs/version-7.8.0/plugin-transform-flow-strip-types.md deleted file mode 100644 index eeccab0ab7..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-flow-strip-types.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-flow-strip-types -title: @babel/plugin-transform-flow-strip-types -sidebar_label: transform-flow-strip-types -original_id: babel-plugin-transform-flow-strip-types ---- - -## Example - -**In** - -```javascript -function foo(one: any, two: number, three?): string {} -``` - -**Out** - -```javascript -function foo(one, two, three) {} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-flow-strip-types -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-flow-strip-types"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-flow-strip-types script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-flow-strip-types"], -}); -``` - -## Options - -### `all` - -`boolean`, defaults to `false`. - -Flow will only parse Flow-specific features if a `@flow` pragma is present atop the file, or the [`all` option](https://flow.org/en/docs/config/options/#toc-all-boolean) is -set inside the `.flowconfig`. - -If you are using the `all` option in your Flow config, be sure to set this option to `true` to get matching behavior. - -For example, without either of the above, the following call expression with a type argument: - -``` -f(e) -``` - -Would get parsed as a nested binary expression: - -```javascript -f < T > e; -``` - -### `requireDirective` - -`boolean`, defaults to `false`. - -Setting this to true will only strip annotations and declarations from files -that contain the `// @flow` directive. It will also throw errors for any Flow -annotations found in files without the directive. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-for-of.md b/website/versioned_docs/version-7.8.0/plugin-transform-for-of.md deleted file mode 100644 index 5c49ad16b8..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-for-of.md +++ /dev/null @@ -1,157 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-for-of -title: @babel/plugin-transform-for-of -sidebar_label: transform-for-of -original_id: babel-plugin-transform-for-of ---- - -## Example - -**In** - -```js -for (var i of foo) {} -``` - -**Out** - -```js -var _iteratorNormalCompletion = true; -var _didIteratorError = false; -var _iteratorError = undefined; - -try { - for (var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var i = _step.value; - } -} catch (err) { - _didIteratorError = true; - _iteratorError = err; -} finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-for-of -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```js -{ - "plugins": ["@babel/plugin-transform-for-of"] -} -``` - -With options: - -```js -{ - "plugins": [ - ["@babel/plugin-transform-for-of", { - "loose": true, // defaults to false - "assumeArray": true // defaults to false - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-for-of script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-for-of"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false` - -In loose mode, arrays are put in a fast path, thus heavily increasing performance. -All other iterables will continue to work fine. - -#### Example - -**In** - -```js -for (var i of foo) {} -``` - -**Out** - -```js -for (var _iterator = foo, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var i = _ref; -} -``` - -#### Abrupt completions - -In loose mode an iterator's `return` method will not be called on abrupt completions caused by thrown errors. - -Please see [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and -[babel/babel#838](https://github.com/babel/babel/issues/838) for more information. - -### `assumeArray` -`boolean`, defaults to `false` - -This will apply the optimization shown below to all for-of loops by assuming that _all_ loops are arrays. - -Can be useful when you just want a for-of loop to represent a basic for loop over an array. - -### Optimization - -If a basic array is used, Babel will compile the for-of loop down to a regular for loop. - -**In** - -```js -for (let a of [1,2,3]) {} -``` - -**Out** - -```js -var _arr = [1, 2, 3]; -for (var _i = 0; _i < _arr.length; _i++) { - var a = _arr[_i]; -} -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-function-name.md b/website/versioned_docs/version-7.8.0/plugin-transform-function-name.md deleted file mode 100644 index 78de89010f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-function-name.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-function-name -title: @babel/plugin-transform-function-name -sidebar_label: transform-function-name -original_id: babel-plugin-transform-function-name ---- - -## Examples - -**In** - -```javascript -let number = (x) => x -``` - -**Out** - -```javascript -var number = function number(x) { - return x; -}; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-function-name -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-function-name"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-function-name script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-function-name"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-inline-consecutive-adds.md b/website/versioned_docs/version-7.8.0/plugin-transform-inline-consecutive-adds.md deleted file mode 100644 index 74a7660b1a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-inline-consecutive-adds.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-inline-consecutive-adds -title: @babel/plugin-transform-inline-consecutive-adds -sidebar_label: transform-inline-consecutive-adds -original_id: babel-plugin-transform-inline-consecutive-adds ---- - -## Example - -**In** - -```javascript -const foo = {}; -foo.a = 42; -foo.b = ["hi"]; -foo.c = bar(); -foo.d = "str"; - -... -const bar = []; -bar.push(1); -bar.push(2); -``` - -**Out** - -```javascript -const foo = { - a: 42, - b: ["hi"], - c: bar(), - d: "str" -}; - -... -const bar = [1, 2]; -``` - -## Installation - -```sh -npm install babel-plugin-transform-inline-consecutive-adds --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-inline-consecutive-adds"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-inline-consecutive-adds script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-inline-consecutive-adds"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-inline-environment-variables.md b/website/versioned_docs/version-7.8.0/plugin-transform-inline-environment-variables.md deleted file mode 100644 index dfab3a3976..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-inline-environment-variables.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-inline-environment-variables -title: babel-plugin-transform-inline-environment-variables -sidebar_label: transform-inline-environment-variables -original_id: babel-plugin-transform-inline-environment-variables ---- - -## Example - -### In - -```js -// assuming process.env.NODE_ENV is actually "development" -process.env.NODE_ENV; -``` - -### Out - -```js -"development"; -``` - -## Installation - -```sh -npm install babel-plugin-transform-inline-environment-variables --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -// without options -{ - "plugins": ["transform-inline-environment-variables"] -} - -// with options -{ - "plugins": [ - ["transform-inline-environment-variables", { - "include": [ - "NODE_ENV" - ] - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins transform-inline-environment-variables script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-inline-environment-variables"] -}); -``` - -## Options - -+ `include` - array of environment variables to include -+ `exclude` - array of environment variables to exclude - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-instanceof.md b/website/versioned_docs/version-7.8.0/plugin-transform-instanceof.md deleted file mode 100644 index 49792f0875..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-instanceof.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-instanceof -title: @babel/plugin-transform-instanceof -sidebar_label: transform-instanceof -original_id: babel-plugin-transform-instanceof ---- - -## Example - -**In** - -```javascript -foo instanceof Bar; -``` - -**Out** - -```javascript -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -_instanceof(foo, Bar); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-instanceof -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-instanceof"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-instanceof script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-instanceof"] -}); -``` - -## References - -* [ES6 Spec: InstanceOf Operator Semantics](https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator) -* [MDN: Symbol.hasInstance](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-jscript.md b/website/versioned_docs/version-7.8.0/plugin-transform-jscript.md deleted file mode 100644 index ba170e4336..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-jscript.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-jscript -title: @babel/plugin-transform-jscript -sidebar_label: transform-jscript -original_id: babel-plugin-transform-jscript ---- - -## Example - -**In** - -```javascript -var foo = function bar() { - -}; -``` - -**Out** - -```javascript -"use strict"; - -var foo = (function () { - function bar() {} - - return bar; -})(); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-jscript -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-jscript"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-jscript script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-jscript"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-literals.md b/website/versioned_docs/version-7.8.0/plugin-transform-literals.md deleted file mode 100644 index 91dc0b5209..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-literals.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-literals -title: @babel/plugin-transform-literals -sidebar_label: transform-literals -original_id: babel-plugin-transform-literals ---- - -## Example - -**In** - -```js -var b = 0b11; // binary integer literal -var o = 0o7; // octal integer literal -const u = 'Hello\u{000A}\u{0009}!'; // unicode string literals, newline and tab -``` - -**Out** - -```js -var b = 3; // binary integer literal -var o = 7; // octal integer literal -const u = 'Hello\n\t!'; // unicode string literals, newline and tab -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-literals -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-literals"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-literals script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-literals"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-member-expression-literals.md b/website/versioned_docs/version-7.8.0/plugin-transform-member-expression-literals.md deleted file mode 100644 index a1f61236c3..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-member-expression-literals.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-member-expression-literals -title: @babel/plugin-transform-member-expression-literals -sidebar_label: transform-member-expression-literals -original_id: babel-plugin-transform-member-expression-literals ---- - -## Example - -**In** - -```javascript -obj.foo = "isValid"; - -obj.const = "isKeyword"; -obj["var"] = "isKeyword"; -``` - -**Out** - -```javascript -obj.foo = "isValid"; - -obj["const"] = "isKeyword"; -obj["var"] = "isKeyword"; -``` - -## Installation - -```sh -npm install @babel/plugin-transform-member-expression-literals --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-member-expression-literals"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-member-expression-literals script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-member-expression-literals"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-merge-sibling-variables.md b/website/versioned_docs/version-7.8.0/plugin-transform-merge-sibling-variables.md deleted file mode 100644 index a94ed00166..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-merge-sibling-variables.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-merge-sibling-variables -title: babel-plugin-transform-merge-sibling-variables -sidebar_label: transform-merge-sibling-variables -original_id: babel-plugin-transform-merge-sibling-variables ---- - -## Example - -**In** - -```javascript -// merge into a single VariableDeclaration -var foo = "bar"; -var bar = "foo"; -foobar(); - -// merge into the next for loop -var i = 0; -for (var x = 0; x < 10; x++) {} -``` - -**Out** - -```javascript -var foo = "bar", - bar = "foo"; -foobar(); - -for (var i = 0, x = 0; x < 10; x++) {} -``` - -## Installation - -```sh -npm install babel-plugin-transform-merge-sibling-variables --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-merge-sibling-variables"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-merge-sibling-variables script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-merge-sibling-variables"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-minify-booleans.md b/website/versioned_docs/version-7.8.0/plugin-transform-minify-booleans.md deleted file mode 100644 index 736c5e9dca..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-minify-booleans.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-minify-booleans -title: babel-plugin-transform-minify-booleans -sidebar_label: transform-minify-booleans -original_id: babel-plugin-transform-minify-booleans ---- - -## Example - -**In** - -```javascript -true; -false; -``` - -**Out** - -```javascript -!0; -!1; -``` - -## Installation - -```sh -npm install babel-plugin-transform-minify-booleans --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-minify-booleans"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-minify-booleans script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-minify-booleans"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-modules-amd.md b/website/versioned_docs/version-7.8.0/plugin-transform-modules-amd.md deleted file mode 100644 index b035934c0e..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-modules-amd.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-modules-amd -title: @babel/plugin-transform-modules-amd -sidebar_label: transform-modules-amd -original_id: babel-plugin-transform-modules-amd ---- - -## Example - -**In** - -```javascript -export default 42; -``` - -**Out** - -```javascript -define(["exports"], function (exports) { - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - exports.default = 42; -}); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-modules-amd -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-modules-amd"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-modules-amd script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-modules-amd"] -}); -``` - -### Options - -See options for `@babel/plugin-transform-modules-commonjs`. - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-modules-commonjs.md b/website/versioned_docs/version-7.8.0/plugin-transform-modules-commonjs.md deleted file mode 100644 index bc5e4fed40..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-modules-commonjs.md +++ /dev/null @@ -1,168 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-modules-commonjs -title: @babel/plugin-transform-modules-commonjs -sidebar_label: transform-modules-commonjs -original_id: babel-plugin-transform-modules-commonjs ---- - -This plugin transforms ES2015 modules to [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1). - -## Example - -**In** - -```javascript -export default 42; -``` - -**Out** - -```javascript -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = 42; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-modules-commonjs -``` - -## Usage - -### With a configuration file (Recommended) - -```js -// without options -{ - "plugins": ["@babel/plugin-transform-modules-commonjs"] -} - -// with options -{ - "plugins": [ - ["@babel/plugin-transform-modules-commonjs", { - "allowTopLevelThis": true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-modules-commonjs script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-modules-commonjs"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -By default, when using exports with babel a non-enumerable `__esModule` property -is exported. - -```javascript -var foo = exports.foo = 5; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -``` - -In environments that don't support this you can enable loose mode on `@babel/plugin-transform-modules-commonjs` -and instead of using `Object.defineProperty` an assignment will be used instead. - -```javascript -var foo = exports.foo = 5; -exports.__esModule = true; -``` - -### `strict` - -`boolean`, defaults to `false` - -By default, when using exports with babel a non-enumerable `__esModule` property -is exported. In some cases this property is used to determine if the import _is_ the -default export or if it _contains_ the default export. - -```javascript -var foo = exports.foo = 5; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -``` - -In order to prevent the `__esModule` property from being exported, you can set -the `strict` option to `true`. - -### `noInterop` - -`boolean`, defaults to `false` - -By default, when using exports with babel a non-enumerable `__esModule` property -is exported. This property is then used to determine if the import _is_ the default -export or if it _contains_ the default export. - -```javascript -"use strict"; - -var _foo = _interopRequireDefault(require("foo")); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -``` - -In cases where the auto-unwrapping of `default` is not needed, you can set the -`noInterop` option to `true` to avoid the usage of the `interopRequireDefault` -helper (shown in inline form above). - -### `lazy` - -`boolean`, `Array`, or `(string) => boolean`, defaults to `false` - -Changes Babel's compiled `import` statements to be lazily evaluated when their -imported bindings are used for the first time. - -This can improve initial load time of your module because evaluating -dependencies up front is sometimes entirely un-necessary. This is especially -the case when implementing a library module. - -The value of `lazy` has a few possible effects: - -* `false` - No lazy initialization of any imported module. -* `true` - Do not lazy-initialize local `./foo` imports, but lazy-init `foo` dependencies. - - Local paths are much more likely to have circular dependencies, which may break if loaded lazily, - so they are not lazy by default, whereas dependencies between independent modules are rarely cyclical. - -* `Array` - Lazy-initialize all imports with source matching one of the given strings. -* `(string) => boolean` - Pass a callback that will be called to decide if a given source string should be lazy-loaded. - -The two cases where imports can never be lazy are: - -* `import "foo";` - - Side-effect imports are automatically non-lazy since their very existence means - that there is no binding to later kick off initialization. - -* `export * from "foo"` - - Re-exporting all names requires up-front execution because otherwise there is no - way to know what names need to be exported. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-modules-systemjs.md b/website/versioned_docs/version-7.8.0/plugin-transform-modules-systemjs.md deleted file mode 100644 index 18bef4127e..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-modules-systemjs.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-modules-systemjs -title: @babel/plugin-transform-modules-systemjs -sidebar_label: transform-modules-systemjs -original_id: babel-plugin-transform-modules-systemjs ---- - -## Example - -**In** - -```javascript -export default 42; -``` - -**Out** - -```javascript -System.register([], function(_export, _context) { - return { - setters: [], - execute: function() { - _export("default", 42); - }, - }; -}); -``` - -For dynamic import support (`import('./lazy.js').then(m => ...)`), enable the [@babel/plugin-syntax-dynamic-import](plugin-syntax-dynamic-import.md) plugin before this one. - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-modules-systemjs -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-modules-systemjs"] -} -``` - -With options: - -```json -{ - "plugins": [ - [ - "@babel/plugin-transform-modules-systemjs", - { - // outputs SystemJS.register(...) - "systemGlobal": "SystemJS" - } - ] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-modules-systemjs script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-modules-systemjs"], -}); -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-modules-umd.md b/website/versioned_docs/version-7.8.0/plugin-transform-modules-umd.md deleted file mode 100644 index 76252249f8..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-modules-umd.md +++ /dev/null @@ -1,216 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-modules-umd -title: @babel/plugin-transform-modules-umd -sidebar_label: transform-modules-umd -original_id: babel-plugin-transform-modules-umd ---- - -## Example - -**In** - -```javascript -export default 42; -``` - -**Out** - -```javascript -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports"], factory); - } else if (typeof exports !== "undefined") { - factory(exports); - } else { - var mod = { - exports: {} - }; - factory(mod.exports); - global.actual = mod.exports; - } -})(this, function (exports) { - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - exports.default = 42; -}); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-modules-umd -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-modules-umd"] -} -``` - -You can also override the names of particular libraries when this module is -running in the browser. For example the `es6-promise` library exposes itself -as `global.Promise` rather than `global.es6Promise`. This can be accommodated by: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-modules-umd", { - "globals": { - "es6-promise": "Promise" - } - }] - ] -} -``` - -#### Default semantics - -There are a few things to note about the default semantics. - -_First_, this transform uses the -[basename](https://en.wikipedia.org/wiki/Basename) of each import to generate -the global names in the UMD output. This means that if you're importing -multiple modules with the same basename, like: - -```js -import fooBar1 from "foo-bar"; -import fooBar2 from "./mylib/foo-bar"; -``` - -it will transpile into two references to the same browser global: - -```js -factory(global.fooBar, global.fooBar); -``` - -If you set the plugin options to: - -```json -{ - "globals": { - "foo-bar": "fooBAR", - "./mylib/foo-bar": "mylib.fooBar" - } -} -``` - -it will still transpile both to one browser global: - -```js -factory(global.fooBAR, global.fooBAR); -``` - -because again the transform is only using the basename of the import. - -_Second_, the specified override will still be passed to the `toIdentifier` -function in [babel-types/src/converters](https://github.com/babel/babel/blob/master/packages/babel-types/src/converters.js). -This means that if you specify an override as a member expression like: - -```json -{ - "globals": { - "fizzbuzz": "fizz.buzz" - } -} -``` - -this will _not_ transpile to `factory(global.fizz.buzz)`. Instead, it will -transpile to `factory(global.fizzBuzz)` based on the logic in `toIdentifier`. - -_Third_, you cannot override the exported global name. - -#### More flexible semantics with `exactGlobals: true` - -All of these behaviors can limit the flexibility of the `globals` map. To -remove these limitations, you can set the `exactGlobals` option to `true`. -Doing this instructs the plugin to: - -1. always use the full import string instead of the basename when generating -the global names -2. skip passing `globals` overrides to the `toIdentifier` function. Instead, -they are used exactly as written, so you will get errors if you do not use -valid identifiers or valid uncomputed (dot) member expressions. -3. allow the exported global name to be overridden via the `globals` map. Any -override must again be a valid identifier or valid member expression. - -Thus, if you set `exactGlobals` to `true` and do not pass any overrides, the -first example of: - -```js -import fooBar1 from "foo-bar"; -import fooBar2 from "./mylib/foo-bar"; -``` - -will transpile to: - -```js -factory(global.fooBar, global.mylibFooBar); -``` - -And if you set the plugin options to: - -```json -{ - "globals": { - "foo-bar": "fooBAR", - "./mylib/foo-bar": "mylib.fooBar" - }, - "exactGlobals": true -} -``` - -then it'll transpile to: - -```js -factory(global.fooBAR, global.mylib.fooBar) -``` - -Finally, with the plugin options set to: - -```json -{ - "plugins": [ - "@babel/plugin-external-helpers", - ["@babel/plugin-transform-modules-umd", { - "globals": { - "my/custom/module/name": "My.Custom.Module.Name" - }, - "exactGlobals": true - }] - ], - "moduleId": "my/custom/module/name" -} -``` - -it will transpile to: - -```js -factory(mod.exports); -global.My = global.My || {}; -global.My.Custom = global.My.Custom || {}; -global.My.Custom.Module = global.My.Custom.Module || {}; -global.My.Custom.Module.Name = mod.exports; -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-modules-umd script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-modules-umd"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-named-capturing-groups-regex.md b/website/versioned_docs/version-7.8.0/plugin-transform-named-capturing-groups-regex.md deleted file mode 100644 index 66e0477b32..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-named-capturing-groups-regex.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-named-capturing-groups-regex -title: @babel/plugin-transform-named-capturing-groups-regex -sidebar_label: transform-named-capturing-groups-regex -original_id: babel-plugin-transform-named-capturing-groups-regex ---- - -> NOTE: This plugin generates code that needs ES6 regular expressions -> functionalities. If you need to support older browsers, use either -> the `runtime: false` option or import a proper polyfill (e.g. `core-js`). - -## Examples - -**In** - -```javascript -var re = /(?\d{4})-(?\d{2})-(?\d{2})/; - -console.log(re.exec("1999-02-29").groups.year) -``` - -**Out** - -```javascript -var re = _wrapRegExp(/(\d{4})-(\d{2})-(\d{2})/, { year: 1, month: 2, day: 3 }); - -console.log(re.exec("1999-02-29").groups.year) -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-named-capturing-groups-regex -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-named-capturing-groups-regex"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-named-capturing-groups-regex script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-named-capturing-groups-regex"] -}); -``` - -## Options - -### `runtime` - -`boolean`, defaults to `true` - -When this option is disabled, Babel doesn't wrap RegExps with the `_wrapRegExp` helper. -The output only supports internal group references, and not runtime properties: - -```js - -var stringRe = /(?"|').*?\k/; - -stringRe.test("'foo'"); // "true", works -stringRe.exec("'foo'").groups.quote; // Error -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-new-target.md b/website/versioned_docs/version-7.8.0/plugin-transform-new-target.md deleted file mode 100644 index 60dd71b944..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-new-target.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-new-target -title: @babel/plugin-transform-new-target -sidebar_label: transform-new-target -original_id: babel-plugin-transform-new-target ---- - - -## Example - -```js -function Foo() { - console.log(new.target); -} - -Foo(); // => undefined -new Foo(); // => Foo -``` - -```js -class Foo { - constructor() { - console.log(new.target); - } -} - -class Bar extends Foo { -} - -new Foo(); // => Foo -new Bar(); // => Bar -``` - -### Caveats - -This plugin relies on `this.constructor`, which means `super` must -already have been called when using untransformed classes. - -```js -class Foo {} - -class Bar extends Foo { - constructor() { - // This will be a problem if classes aren't transformed to ES5 - new.target; - super(); - } -} -``` - -Additionally, this plugin cannot transform all `Reflect.construct` cases -when using `newTarget` with ES5 function classes (transformed ES6 classes). - -```js -function Foo() { - console.log(new.target); -} - -// Bar extends Foo in ES5 -function Bar() { - Foo.call(this); -} -Bar.prototype = Object.create(Foo.prototype); -Bar.prototype.constructor = Bar; - -// Baz does not extend Foo -function Baz() {} - -Reflect.construct(Foo, []); // => Foo (correct) -Reflect.construct(Foo, [], Bar); // => Bar (correct) - -Reflect.construct(Bar, []); // => Bar (incorrect, though this is how ES5 - // inheritance is commonly implemented.) -Reflect.construct(Foo, [], Baz); // => undefined (incorrect) -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-new-target -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-new-target"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-new-target script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-new-target"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-node-env-inline.md b/website/versioned_docs/version-7.8.0/plugin-transform-node-env-inline.md deleted file mode 100644 index 6eb2bd72b7..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-node-env-inline.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-node-env-inline -title: babel-plugin-transform-node-env-inline -sidebar_label: transform-node-env-inline -original_id: babel-plugin-transform-node-env-inline ---- - - -## Example - -**In** - -```javascript -process.env.NODE_ENV === "development"; -process.env.NODE_ENV === "production"; -``` - -**Out** - -```sh -NODE_ENV=development babel in.js --plugins transform-node-env-inline -``` - -```javascript -true; -false; -``` - -## Installation - -```sh -npm install babel-plugin-transform-node-env-inline --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-node-env-inline"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-node-env-inline script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-node-env-inline"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-object-assign.md b/website/versioned_docs/version-7.8.0/plugin-transform-object-assign.md deleted file mode 100644 index 0206728b10..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-object-assign.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-object-assign -title: @babel/plugin-transform-object-assign -sidebar_label: transform-object-assign -original_id: babel-plugin-transform-object-assign ---- - -## Example - -**In** - -```javascript -Object.assign(a, b); -``` - -**Out** - -```javascript -var _extends = ...; - -_extends(a, b); -``` - -## Caveats - -- Will only work with code of the form `Object.assign` or `Object['assign']`. The following patterns are not supported: - - ```javascript - var { assign } = Object; - var assign = Object.assign; - ``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-object-assign -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-object-assign"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-object-assign script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-object-assign"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-object-set-prototype-of-to-assign.md b/website/versioned_docs/version-7.8.0/plugin-transform-object-set-prototype-of-to-assign.md deleted file mode 100644 index 237eb3e808..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-object-set-prototype-of-to-assign.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-object-set-prototype-of-to-assign -title: @babel/plugin-transform-object-set-prototype-of-to-assign -sidebar_label: transform-object-set-prototype-of-to-assign -original_id: babel-plugin-transform-object-set-prototype-of-to-assign ---- - -**NOTE:** There are some caveats when using this plugin, see the [`@babel/plugin-transform-proto-to-assign`](plugin-transform-proto-to-assign.md) docs for more information. - -## Example - -**In** - -```javascript -Object.setPrototypeOf(bar, foo); -``` - -**Out** - -```javascript -var _defaults = ...; - -_defaults(bar, foo); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-object-set-prototype-of-to-assign -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-object-set-prototype-of-to-assign"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-object-set-prototype-of-to-assign script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-object-set-prototype-of-to-assign"], -}); -``` diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-object-super.md b/website/versioned_docs/version-7.8.0/plugin-transform-object-super.md deleted file mode 100644 index 8db1d4e9ac..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-object-super.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-object-super -title: @babel/plugin-transform-object-super -sidebar_label: transform-object-super -original_id: babel-plugin-transform-object-super ---- - -## Examples - -**In** - -```javascript -let obj = { - say () { - return "Hello" - } -} - -let obj2 = { - say () { - return super.say() + "World!" - } -} -``` - -**Out** - -```javascript -var _obj; - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var obj = { - say: function say() { - return "Hello"; - } -}; - -var obj2 = _obj = { - say: function say() { - return _get(_obj.__proto__ || Object.getPrototypeOf(_obj), "say", this).call(this) + "World!"; - } -}; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-object-super -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-object-super"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-object-super script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-object-super"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-parameters.md b/website/versioned_docs/version-7.8.0/plugin-transform-parameters.md deleted file mode 100644 index 35f8e76022..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-parameters.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-parameters -title: @babel/plugin-transform-parameters -sidebar_label: transform-parameters -original_id: babel-plugin-transform-parameters ---- - -This plugin transforms ES2015 parameters to ES5, this includes: - -- Destructuring parameters -- Default parameters -- Rest parameters - -## Examples - -**In** - -```javascript -function test(x = "hello", { a, b }, ...args) { - console.log(x, a, b, args); -} -``` - -**Out** - -```javascript -function test() { - var x = - arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "hello"; - var _ref = arguments[1]; - var a = _ref.a, - b = _ref.b; - - for ( - var _len = arguments.length, - args = Array(_len > 2 ? _len - 2 : 0), - _key = 2; - _key < _len; - _key++ - ) { - args[_key - 2] = arguments[_key]; - } - - console.log(x, a, b, args); -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-parameters -``` - -## Caveats - -Default parameters desugar into `let` declarations to retain proper semantics. If this is -not supported in your environment then you'll need the -[@babel/plugin-transform-block-scoping](plugin-transform-block-scoping.md) plugin. - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-parameters"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-parameters script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-parameters"], -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -In loose mode, parameters with default values will be counted into the arity of the function. This is not spec behavior where these parameters do not add to function arity. - -The `loose` implementation is a more performant solution as JavaScript engines will fully optimize a function that doesn't reference `arguments`. Please do your own benchmarking and determine if this option is the right fit for your application. - -```javascript -// Spec behavior -function bar1(arg1 = 1) {} -bar1.length; // 0 - -// Loose mode -function bar1(arg1 = 1) {} -bar1.length; // 1 -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-property-literals.md b/website/versioned_docs/version-7.8.0/plugin-transform-property-literals.md deleted file mode 100644 index 7d9919902c..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-property-literals.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-property-literals -title: @babel/plugin-transform-property-literals -sidebar_label: transform-property-literals -original_id: babel-plugin-transform-property-literals ---- - -## Example - -**In** - -```javascript -var foo = { - // changed - "bar": function () {}, - "1": function () {}, - - // not changed - "default": 1, - [a]: 2, - foo: 1 -}; -``` - -**Out** - -```javascript -var foo = { - bar: function () {}, - 1: function () {}, - - "default": 1, - [a]: 2, - foo: 1 -}; -``` - -## Installation - -```sh -npm install @babel/plugin-transform-property-literals --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-property-literals"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-property-literals script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-property-literals"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-property-mutators.md b/website/versioned_docs/version-7.8.0/plugin-transform-property-mutators.md deleted file mode 100644 index 2e251280f7..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-property-mutators.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-property-mutators -title: @babel/plugin-transform-property-mutators -sidebar_label: transform-property-mutators -original_id: babel-plugin-transform-property-mutators ---- - -## Example - -**In** - -```javascript -var foo = { - get bar() { - return this._bar; - }, - set bar(value) { - this._bar = value; - } -}; -``` - -**Out** - -```javascript -var foo = Object.defineProperties({}, { - bar: { - get: function () { - return this._bar; - }, - set: function (value) { - this._bar = value; - }, - configurable: true, - enumerable: true - } -}); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-property-mutators -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-property-mutators"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-property-mutators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-property-mutators"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-proto-to-assign.md b/website/versioned_docs/version-7.8.0/plugin-transform-proto-to-assign.md deleted file mode 100644 index beaddeac00..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-proto-to-assign.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-proto-to-assign -title: @babel/plugin-transform-proto-to-assign -sidebar_label: transform-proto-to-assign -original_id: babel-plugin-transform-proto-to-assign ---- - -## Detail - -This means that the following **will** work: - -```javascript -var foo = { a: 1 }; -var bar = { b: 2 }; -bar.__proto__ = foo; -bar.a; // 1 -bar.b; // 2 -``` - -however the following **will not**: - -```javascript -var foo = { a: 1 }; -var bar = { b: 2 }; -bar.__proto__ = foo; -bar.a; // 1 -foo.a = 2; -bar.a; // 1 - should be 2 but remember that nothing is bound and it's a straight copy -``` - -This is a case that you have to be aware of if you intend to use this plugin. - -## Example - -**In** - -```javascript -bar.__proto__ = foo; -``` - -**Out** - -```javascript -function _defaults(obj, defaults) { ... } - -_defaults(bar, foo); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-proto-to-assign -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-proto-to-assign"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-proto-to-assign script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-proto-to-assign"] -}); -``` - -## References - -* [MDN: Object.prototype.\_\_proto\_\_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-constant-elements.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-constant-elements.md deleted file mode 100644 index f7a11f6ffa..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-constant-elements.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-constant-elements -title: @babel/plugin-transform-react-constant-elements -sidebar_label: transform-react-constant-elements -original_id: babel-plugin-transform-react-constant-elements ---- - -This plugin can speed up reconciliation and reduce garbage collection pressure by hoisting -React elements to the highest possible scope, preventing multiple unnecessary reinstantiations. - -## Example - -**In** - -```jsx -const Hr = () => { - return
; -}; -``` - -**Out** - -```jsx -const _ref =
; - -const Hr = () => { - return _ref; -}; -``` - -**Deopts** - -- **Spread Operator** - - ```jsx -
- ``` - -- **Refs** - - ```jsx -
-
this.node = node} /> - ``` - -- **Mutable Properties** - -> See https://github.com/facebook/react/issues/3226 for more on this - - ```js -
- ``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-constant-elements -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-react-constant-elements"] -} -``` - -## Options - -### `allowMutablePropsOnTags` - -`Array`, defaults to `[]` - -If you are using a particular library (like react-intl) that uses object properties, and you are sure -that the element won't modify its own props, you can whitelist the element so that objects are allowed. - -This will skip the `Mutable Properties` deopt. - -```json -{ - "plugins": [ - ["@babel/plugin-transform-react-constant-elements", {"allowMutablePropsOnTags": ["FormattedMessage"]}], - ] -} - -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-constant-elements script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-constant-elements"] -}); -``` - -## References - -* [[facebook/react#3226] Optimizing Compiler: Reuse Constant Value Types like ReactElement](https://github.com/facebook/react/issues/3226) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-display-name.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-display-name.md deleted file mode 100644 index d30eed975a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-display-name.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-display-name -title: @babel/plugin-transform-react-display-name -sidebar_label: transform-react-display-name -original_id: babel-plugin-transform-react-display-name ---- - -## Example - -**In** - -```js -var foo = React.createClass({}); // React <= 15 -var bar = createReactClass({}); // React 16+ -``` - -**Out** - -```js -var foo = React.createClass({ - displayName: "foo" -}); // React <= 15 -var bar = createReactClass({ - displayName: "bar" -}); // React 16+ -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-display-name -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-react-display-name"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-display-name script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-display-name"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-inline-elements.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-inline-elements.md deleted file mode 100644 index dd73cc6225..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-inline-elements.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-inline-elements -title: @babel/plugin-transform-react-inline-elements -sidebar_label: transform-react-inline-elements -original_id: babel-plugin-transform-react-inline-elements ---- - -## Note - -When used alongside `@babel/plugin-transform-runtime`, polyfills (by default including `Symbol`) are specifically scoped to not pollute the global scope. This breaks usage with React, as it won't have access to that polyfill and will cause your application to fail in legacy browsers. - -Even if `['@babel/plugin-transform-runtime', { helpers: true, polyfill: false }]` is specified, it might still break, since `helpers` come precompiled. - -In this case, we recommend importing/requiring `@babel/polyfill` in the entry point of your application and using `@babel/preset-env` with the `useBuiltIns` option to only include the polyfills your targets need. Alternatively, you can also import/require `core-js/modules/es6.symbol` by itself. - -This transform **should be enabled only in production** (e.g., just before minifying your code) because, although it improves runtime performance, it makes warning messages more cryptic and skips important checks that happen in development mode, including propTypes. - -## Example - -**In** - -```javascript -; -``` - -**Out** - -```javascript -babelHelpers.jsx(Baz, { - foo: "bar" -}, "1"); - -/** - * Instead of - * - * React.createElement(Baz, { - * foo: "bar", - * key: "1", - * }); - */ -``` - -**Deopt** - -```js -// The plugin will still use React.createElement when `ref` or `object rest spread` is used - - -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-inline-elements -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-react-inline-elements"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-inline-elements script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-inline-elements"] -}); -``` - -## References - -* [[facebook/react#3228] Optimizing Compiler: Inline React Elements](https://github.com/facebook/react/issues/3228) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-compat.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-compat.md deleted file mode 100644 index 7bdab587f6..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-compat.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-jsx-compat -title: @babel/plugin-transform-react-jsx-compat -sidebar_label: transform-react-jsx-compat -original_id: babel-plugin-transform-react-jsx-compat ---- - -## Example - -**In** - -```javascript -var profile =
- -

{[user.firstName, user.lastName].join(' ')}

-
; -``` - -**Out** - -```javascript -var profile = React.DOM.div(null, - React.DOM.img({ src: "avatar.png", "class": "profile" }), - React.DOM.h3(null, [user.firstName, user.lastName].join(" ")) -); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-jsx-compat -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-react-jsx-compat"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-jsx-compat script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-jsx-compat"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-self.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-self.md deleted file mode 100644 index 36153c0394..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-self.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-jsx-self -title: @babel/plugin-transform-react-jsx-self -sidebar_label: transform-react-jsx-self -original_id: babel-plugin-transform-react-jsx-self ---- - -## Example - -**In** - -``` - -``` - -**Out** - -``` - -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-jsx-self -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-react-jsx-self"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-jsx-self script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-jsx-self"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-source.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-source.md deleted file mode 100644 index 3f4f58aa14..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx-source.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-jsx-source -title: @babel/plugin-transform-react-jsx-source -sidebar_label: transform-react-jsx-source -original_id: babel-plugin-transform-react-jsx-source ---- - -## Example - -**In** - -``` - -``` - -**Out** - -``` - -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-jsx-source -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-react-jsx-source"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-jsx-source script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-jsx-source"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx.md b/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx.md deleted file mode 100644 index 000046c6c4..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-react-jsx.md +++ /dev/null @@ -1,210 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-react-jsx -title: @babel/plugin-transform-react-jsx -sidebar_label: transform-react-jsx -original_id: babel-plugin-transform-react-jsx ---- - -## Example - -### React - -**In** - -```javascript -const profile = ( -
- -

{[user.firstName, user.lastName].join(' ')}

-
-); -``` - -**Out** - -```javascript -const profile = React.createElement("div", null, - React.createElement("img", { src: "avatar.png", className: "profile" }), - React.createElement("h3", null, [user.firstName, user.lastName].join(" ")) -); -``` - -### Custom - -**In** - -```javascript -/** @jsx Preact.h */ - -import Preact from 'preact'; - -const profile = ( -
- -

{[user.firstName, user.lastName].join(' ')}

-
-); -``` - -**Out** - -```javascript -/** @jsx Preact.h */ - -import Preact from 'preact'; - -const profile = Preact.h("div", null, - Preact.h("img", { src: "avatar.png", className: "profile" }), - Preact.h("h3", null, [user.firstName, user.lastName].join(" ")) -); -``` - -### Fragments - -Fragments are a feature available in React 16.2.0+. - -#### React - -**In** - -```javascript -const descriptions = items.map(item => ( - <> -
{item.name}
-
{item.value}
- -)); -``` - -**Out** - -```javascript -const descriptions = items.map(item => React.createElement( - React.Fragment, - null, - React.createElement("dt", null, item.name), - React.createElement("dd", null, item.value) -)); -``` - -#### Custom - -**In** - -```javascript -/** @jsx Preact.h */ -/** @jsxFrag Preact.Fragment */ - -import Preact from 'preact'; - -var descriptions = items.map(item => ( - <> -
{item.name}
-
{item.value}
- -)); -``` - -**Out** - -```javascript -/** @jsx Preact.h */ -/** @jsxFrag Preact.Fragment */ - -import Preact from 'preact'; - -var descriptions = items.map(item => Preact.h( - Preact.Fragment, - null, - Preact.h("dt", null, item.name), - Preact.h("dd", null, item.value) -)); -``` - -Note that if a custom pragma is specified, then a custom fragment pragma must also be specified if the `<>` is used. Otherwise, an error will be thrown. - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-react-jsx -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-react-jsx"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-react-jsx", { - "pragma": "Preact.h", // default pragma is React.createElement - "pragmaFrag": "Preact.Fragment", // default is React.Fragment - "throwIfNamespace": false // defaults to true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-react-jsx script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-react-jsx"] -}); -``` - -## Options - -### `pragma` - -`string`, defaults to `React.createElement`. - -Replace the function used when compiling JSX expressions. - -Note that the `@jsx React.DOM` pragma has been deprecated as of React v0.12 - -### `pragmaFrag` - -`string`, defaults to `React.Fragment`. - -Replace the component used when compiling JSX fragments. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -When spreading props, use `Object.assign` directly instead of Babel's extend helper. - -### `useSpread` - -`boolean`, defaults to `false`. - -When spreading props, use inline object with spread elements directly instead of Babel's extend helper or `Object.assign`. - -### `throwIfNamespace` - -`boolean`, defaults to `true`. - -Toggles whether or not to throw an error if an XML namespaced tag name is used. For example: - - - -Though the JSX spec allows this, it is disabled by default since React's JSX does not currently have support for it. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-regenerator.md b/website/versioned_docs/version-7.8.0/plugin-transform-regenerator.md deleted file mode 100644 index b82c0fae4e..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-regenerator.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-regenerator -title: @babel/plugin-transform-regenerator -sidebar_label: transform-regenerator -original_id: babel-plugin-transform-regenerator ---- - -## Example - -**In** - -```javascript -function* a() { - yield 1; -} -``` - -**Out** - -```javascript -var _marked = [a].map(regeneratorRuntime.mark); - -function a() { - return regeneratorRuntime.wrap(function a$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return 1; - - case 2: - case "end": - return _context.stop(); - } - } - }, _marked[0], this); -} -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-regenerator -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-regenerator"] -} -``` - -With options: - -|name|default value| -|---|---| -|asyncGenerators|true| -|generators|true| -|async|true| - -```json -{ - "plugins": [ - ["@babel/plugin-transform-regenerator", { - "asyncGenerators": false, - "generators": false, - "async": false - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-regenerator script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-regenerator"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-regexp-constructors.md b/website/versioned_docs/version-7.8.0/plugin-transform-regexp-constructors.md deleted file mode 100644 index 73ccc1e160..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-regexp-constructors.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-regexp-constructors -title: babel-plugin-transform-regexp-constructors -sidebar_label: transform-regexp-constructors -original_id: babel-plugin-transform-regexp-constructors ---- - -## Example - -**In** - -```javascript -const foo = 'ab+'; -var a = new RegExp(foo+'c', 'i'); -``` - -**Out** - -```javascript -const foo = 'ab+'; -var a = /ab+c/i; -``` - -## Installation - -```sh -npm install babel-plugin-transform-regexp-constructors --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-regexp-constructors"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-regexp-constructors script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-regexp-constructors"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-remove-console.md b/website/versioned_docs/version-7.8.0/plugin-transform-remove-console.md deleted file mode 100644 index f0d151c5b6..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-remove-console.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-remove-console -title: babel-plugin-transform-remove-console -sidebar_label: transform-remove-console -original_id: babel-plugin-transform-remove-console ---- - -## Example - -**In** - -```javascript -console.log("foo"); -console.error("bar"); -``` - -**Out** - -```javascript -``` - -## Installation - -```sh -npm install babel-plugin-transform-remove-console --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -// without options -{ - "plugins": ["transform-remove-console"] -} -``` - -```json -// with options -{ - "plugins": [ ["transform-remove-console", { "exclude": [ "error", "warn"] }] ] -} -``` - -### Via CLI - -```sh -babel --plugins transform-remove-console script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-remove-console"] -}); -``` - -## Options - -+ `exclude` - An array of console methods to exclude from removal. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-remove-debugger.md b/website/versioned_docs/version-7.8.0/plugin-transform-remove-debugger.md deleted file mode 100644 index b7bfa2a14f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-remove-debugger.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-remove-debugger -title: babel-plugin-transform-remove-debugger -sidebar_label: transform-remove-debugger -original_id: babel-plugin-transform-remove-debugger ---- - -## Example - -**In** - -```javascript -debugger; -``` - -**Out** - -```javascript -``` - -## Installation - -```sh -npm install babel-plugin-transform-remove-debugger --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-remove-debugger"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-remove-debugger script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-remove-debugger"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-remove-undefined.md b/website/versioned_docs/version-7.8.0/plugin-transform-remove-undefined.md deleted file mode 100644 index 7ec6f55f11..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-remove-undefined.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-remove-undefined -title: babel-plugin-transform-remove-undefined -sidebar_label: transform-remove-undefined -original_id: babel-plugin-transform-remove-undefined ---- - -For functions, this removes return arguments that evaluate to `undefined`. - -## Example - -**In** - -```javascript -let a = void 0; -function foo() { - var b = undefined; - return undefined; -} -``` - -**Out** - -```javascript -let a; -function foo() { - var b; - return; -} -``` - -## Installation - -```sh -npm install babel-plugin-transform-remove-undefined --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["babel-plugin-transform-remove-undefined"] -} -``` - -### Via CLI - -```sh -babel --plugins babel-plugin-transform-remove-undefined script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["babel-plugin-transform-remove-undefined"] -}); -``` - -## Options - -+ `tdz` - Detect usages before declaration/initialization in let/const(throws) and var(void 0) - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-reserved-words.md b/website/versioned_docs/version-7.8.0/plugin-transform-reserved-words.md deleted file mode 100644 index 28cdb18811..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-reserved-words.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-reserved-words -title: @babel/plugin-transform-reserved-words -sidebar_label: transform-reserved-words -original_id: babel-plugin-transform-reserved-words ---- - -Some words were reserved in ES3 as potential future keywords but were not -reserved in ES5 and later. This plugin, to be used when targeting ES3 -environments, renames variables from that set of words. - -## Example - -**In** - -```javascript -var abstract = 1; -var x = abstract + 1; -``` - -**Out** - -```javascript -var _abstract = 1; -var x = _abstract + 1; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-reserved-words -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-reserved-words"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-reserved-words script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-reserved-words"] -}); -``` - -## References - -* [ES3 Spec: Future Reserved Words](http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf#page=26) - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-shorthand-properties.md b/website/versioned_docs/version-7.8.0/plugin-transform-shorthand-properties.md deleted file mode 100644 index 1a78275a6a..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-shorthand-properties.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-shorthand-properties -title: @babel/plugin-transform-shorthand-properties -sidebar_label: transform-shorthand-properties -original_id: babel-plugin-transform-shorthand-properties ---- - -## Example - -**In** - -```js -var o = { a, b, c }; -``` - -**Out** - -```js -var o = { a: a, b: b, c: c }; -``` - -**In** - -```js -var cat = { - getName() { - return name; - } -}; -``` - -**Out** - -```js -var cat = { - getName: function () { - return name; - } -}; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-shorthand-properties -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-shorthand-properties"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-shorthand-properties script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-shorthand-properties"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-simplify-comparison-operators.md b/website/versioned_docs/version-7.8.0/plugin-transform-simplify-comparison-operators.md deleted file mode 100644 index 2d497b523d..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-simplify-comparison-operators.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-simplify-comparison-operators -title: babel-plugin-transform-simplify-comparison-operators -sidebar_label: transform-simplify-comparison-operators -original_id: babel-plugin-transform-simplify-comparison-operators ---- - -## Example - -**In** - -```javascript -typeof foo === "object"; -``` - -**Out** - -```javascript -typeof foo == "object"; -``` - -## Installation - -```sh -npm install babel-plugin-transform-simplify-comparison-operators --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-simplify-comparison-operators"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-simplify-comparison-operators script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-simplify-comparison-operators"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-spread.md b/website/versioned_docs/version-7.8.0/plugin-transform-spread.md deleted file mode 100644 index b9370f164b..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-spread.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-spread -title: @babel/plugin-transform-spread -sidebar_label: transform-spread -original_id: babel-plugin-transform-spread ---- - -## Example - -**In** - -```js -var a = ['a', 'b', 'c']; - -var b = [...a, 'foo']; - -var c = foo(...a); -``` - -**Out** - -```js -var a = ['a', 'b', 'c']; - -var b = a.concat(['foo']); - -var c = foo.apply(void 0, a); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-spread -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-spread"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-spread", { - "loose": true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-spread script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-spread"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -In loose mode, **all** iterables are assumed to be arrays. - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) - -## References - -* [MDN: Spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-sticky-regex.md b/website/versioned_docs/version-7.8.0/plugin-transform-sticky-regex.md deleted file mode 100644 index 9cdafb488b..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-sticky-regex.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-sticky-regex -title: @babel/plugin-transform-sticky-regex -sidebar_label: transform-sticky-regex -original_id: babel-plugin-transform-sticky-regex ---- - -## Examples - -**In** - -```javascript -const a = /o+/y; -``` - -**Out** - -```javascript -var a = new RegExp("o+", "y"); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-sticky-regex -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-sticky-regex"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-sticky-regex script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-sticky-regex"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-strict-mode.md b/website/versioned_docs/version-7.8.0/plugin-transform-strict-mode.md deleted file mode 100644 index a1847a6ed2..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-strict-mode.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-strict-mode -title: @babel/plugin-transform-strict-mode -sidebar_label: transform-strict-mode -original_id: babel-plugin-transform-strict-mode ---- - -This plugin may be enabled via `@babel/plugin-transform-modules-commonjs`. -If you wish to disable it you can either turn `strict` off or pass -`strictMode: false` as an option to the commonjs transform. - -## Example - -**In** - -```javascript -foo(); -``` - -**Out** - -```javascript -"use strict"; - -foo(); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-strict-mode -``` - -## Usage - -### With a configuration file (Recommended) - - -```json -{ - "plugins": ["@babel/plugin-transform-strict-mode"] -} -``` - - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-strict-mode script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-strict-mode"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-template-literals.md b/website/versioned_docs/version-7.8.0/plugin-transform-template-literals.md deleted file mode 100644 index 25be9f8d83..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-template-literals.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-template-literals -title: @babel/plugin-transform-template-literals -sidebar_label: transform-template-literals -original_id: babel-plugin-transform-template-literals ---- - -## Example - -**In** - -```javascript -`foo${bar}`; -``` - -**Out** - -```javascript -"foo".concat(bar); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-template-literals -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "plugins": ["@babel/plugin-transform-template-literals"] -} -``` - -With options: - -```json -{ - "plugins": [ - ["@babel/plugin-transform-template-literals", { - "loose": true - }] - ] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-template-literals script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-template-literals"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -When `true`, tagged template literal objects aren't frozen. All template literal expressions and quasis are combined with the `+` operator instead of with `String.prototype.concat`. - -When `false` or not set, all template literal expressions and quasis are combined with `String.prototype.concat`. It will handle cases with `Symbol.toPrimitive` correctly and throw correctly if template literal expression is a `Symbol()`. See [babel/babel#5791](https://github.com/babel/babel/pull/5791). - -**In** - -```javascript -`foo${bar}`; -``` - -**Out** - -```javascript -"foo" + bar; -``` - -> You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-typeof-symbol.md b/website/versioned_docs/version-7.8.0/plugin-transform-typeof-symbol.md deleted file mode 100644 index fa8932f7bb..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-typeof-symbol.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-typeof-symbol -title: @babel/plugin-transform-typeof-symbol -sidebar_label: transform-typeof-symbol -original_id: babel-plugin-transform-typeof-symbol ---- - -## Example - -**In** - -```javascript -typeof Symbol() === "symbol"; -``` - -**Out** - -```javascript -var _typeof = function (obj) { - return obj && obj.constructor === Symbol ? "symbol" : typeof obj; -}; - -_typeof(Symbol()) === "symbol"; -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-typeof-symbol -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-typeof-symbol"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-typeof-symbol script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-typeof-symbol"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-undefined-to-void.md b/website/versioned_docs/version-7.8.0/plugin-transform-undefined-to-void.md deleted file mode 100644 index f095de465f..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-undefined-to-void.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-undefined-to-void -title: babel-plugin-transform-undefined-to-void -sidebar_label: transform-undefined-to-void -original_id: babel-plugin-transform-undefined-to-void ---- - -This plugin transforms `undefined` into `void 0` which returns undefined regardless of if it's been reassigned. - -## Example - -**In** - -```javascript -foo === undefined; -``` - -**Out** - -```javascript -foo === void 0; -``` - -## Installation - -```sh -npm install babel-plugin-transform-undefined-to-void --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["transform-undefined-to-void"] -} -``` - -### Via CLI - -```sh -babel --plugins transform-undefined-to-void script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["transform-undefined-to-void"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/plugin-transform-unicode-regex.md b/website/versioned_docs/version-7.8.0/plugin-transform-unicode-regex.md deleted file mode 100644 index 7c520ad700..0000000000 --- a/website/versioned_docs/version-7.8.0/plugin-transform-unicode-regex.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: version-7.8.0-babel-plugin-transform-unicode-regex -title: @babel/plugin-transform-unicode-regex -sidebar_label: transform-unicode-regex -original_id: babel-plugin-transform-unicode-regex ---- - -## Example - -**In** - -```js -var string = "foo💩bar"; -var match = string.match(/foo(.)bar/u); -``` - -**Out** - -```js -var string = "foo💩bar"; -var match = string.match(/foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))bar/); -``` - -## Installation - -```sh -npm install --save-dev @babel/plugin-transform-unicode-regex -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "plugins": ["@babel/plugin-transform-unicode-regex"] -} -``` - -### Via CLI - -```sh -babel --plugins @babel/plugin-transform-unicode-regex script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - plugins: ["@babel/plugin-transform-unicode-regex"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/preset-es2015.md b/website/versioned_docs/version-7.8.0/preset-es2015.md deleted file mode 100644 index 39be40b036..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-es2015.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: version-7.8.0-babel-preset-es2015 -title: @babel/preset-es2015 -sidebar_label: es2015 -original_id: babel-preset-es2015 ---- - -> As of Babel v6, all the yearly presets have been deprecated. -> We recommend using [`@babel/preset-env`](preset-env.md) instead. - -## Install - -```sh -npm install --save-dev @babel/preset-es2015 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-es2015"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-es2015 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-es2015"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -Enable "loose" transformations for any plugins in this preset that allow them. - -### `modules` - -`"amd" | "umd" | "systemjs" | "commonjs" | "cjs" | false`, defaults to `"commonjs"`. - -Enable transformation of ES6 module syntax to another module type. - -Setting this to `false` will not transform modules. - -### `spec` - -`boolean`, defaults to `false`. - -Enable "spec" transformations for any plugins in this preset that allow them. - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) diff --git a/website/versioned_docs/version-7.8.0/preset-es2016.md b/website/versioned_docs/version-7.8.0/preset-es2016.md deleted file mode 100644 index 1918a901e5..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-es2016.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: version-7.8.0-babel-preset-es2016 -title: @babel/preset-es2016 -sidebar_label: es2016 -original_id: babel-preset-es2016 ---- - -> As of Babel v6, all the yearly presets have been deprecated. -> We recommend using [`@babel/preset-env`](preset-env.md) instead. - -## Install - -```sh -npm install --save-dev @babel/preset-es2016 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-es2016"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-es2016 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-es2016"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/preset-es2017.md b/website/versioned_docs/version-7.8.0/preset-es2017.md deleted file mode 100644 index a637e24330..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-es2017.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: version-7.8.0-babel-preset-es2017 -title: @babel/preset-es2017 -sidebar_label: es2017 -original_id: babel-preset-es2017 ---- - -> As of Babel v6, all the yearly presets have been deprecated. -> We recommend using [`@babel/preset-env`](preset-env.md) instead. - -## Install - -```sh -npm install --save-dev @babel/preset-es2017 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-es2017"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-es2017 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-es2017"] -}); -``` - diff --git a/website/versioned_docs/version-7.8.0/preset-flow.md b/website/versioned_docs/version-7.8.0/preset-flow.md deleted file mode 100644 index 6961d9a719..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-flow.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: version-7.8.0-babel-preset-flow -title: @babel/preset-flow -sidebar_label: flow -original_id: babel-preset-flow ---- - -This preset includes the following plugins: - -- [@babel/plugin-transform-flow-strip-types](plugin-transform-flow-strip-types.md) - -## Example - -**In** - -```javascript -function foo(one: any, two: number, three?): string {} -``` - -**Out** - -```javascript -function foo(one, two, three) {} -``` - -## Installation - -```sh -npm install --save-dev @babel/preset-flow -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-flow"] -} -``` - -### Via CLI - -```sh -babel --presets @babel/preset-flow script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-flow"], -}); -``` - -## Options - -### `all` - -`boolean`, defaults to `false`. - -Flow will only parse Flow-specific features if a `@flow` pragma is present atop the file, or the [`all` option](https://flow.org/en/docs/config/options/#toc-all-boolean) is -set inside the `.flowconfig`. - -If you are using the `all` option in your Flow config, be sure to set this option to `true` to get matching behavior. - -For example, without either of the above set, the following call expression with a type argument: - -``` -f(e) -``` - -Would get parsed as a nested binary expression: - -```javascript -f < T > e; -``` - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) diff --git a/website/versioned_docs/version-7.8.0/preset-minify.md b/website/versioned_docs/version-7.8.0/preset-minify.md deleted file mode 100644 index d62abb6f58..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-minify.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -id: version-7.8.0-babel-preset-minify -title: babel-preset-minify -sidebar_label: minify -original_id: babel-preset-minify ---- - -+ [Install](#install) -+ [Usage](#usage) -+ [Options](#options) - -## Install - -```sh -npm install babel-preset-minify --save-dev -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["minify"] -} -``` - -or pass in options - - -```json -{ - "presets": [["minify", { - "mangle": { - "exclude": ["MyCustomError"] - }, - "unsafe": { - "typeConstructors": false - }, - "keepFnName": true - }]] -} -``` - -### Via CLI - -```sh -babel script.js --presets minify -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["minify"] -}); -``` - -## Options - -Two types of options: - -1. 1-1 mapping with plugin -2. The same option passed to multiple plugins - -#### 1-1 mapping with plugin - -+ `false` - disable plugin -+ `true` - enable plugin -+ `{ ...pluginOpts }` - enable plugin and pass pluginOpts to plugin - -OptionName | Plugin | DefaultValue ----------- | ------ | ------------ -booleans | [transform-minify-booleans][booleans] | true -builtIns | [minify-builtins][builtIns] | true -consecutiveAdds | [transform-inline-consecutive-adds][consecutiveAdds] | true -deadcode | [minify-dead-code-elimination][deadcode] | true -evaluate | [minify-constant-folding][evaluate] | true -flipComparisons | [minify-flip-comparisons][flipComparisons] | true -guards | [minify-guarded-expressions][guards] | true -infinity | [minify-infinity][infinity] | true -mangle | [minify-mangle-names][mangle] | true -memberExpressions | [transform-member-expression-literals][memberExpressions] | true -mergeVars | [transform-merge-sibling-variables][mergeVars] | true -numericLiterals | [minify-numeric-literals][numericLiterals] | true -propertyLiterals | [transform-property-literals][propertyLiterals] | true -regexpConstructors | [transform-regexp-constructors][regexpConstructors] | true -removeConsole | [transform-remove-console][removeConsole] | false -removeDebugger | [transform-remove-debugger][removeDebugger] | false -removeUndefined | [transform-remove-undefined][removeUndefined] | true -replace | [minify-replace][replace] | true -simplify | [minify-simplify][simplify] | true -simplifyComparisons | [transform-simplify-comparison-operators][simplifyComparisons] | true -typeConstructors | [minify-type-constructors][typeConstructors] | true -undefinedToVoid | [transform-undefined-to-void][undefinedToVoid] | true - -#### The same option passed to multiple plugins - -+ When multiple plugins require the same option, it's easier to declare it in one place. These options are passed on to two or more plugins. - -OptionName | Plugins ----------- | ------- -keepFnName | Passed to [mangle][mangle] & [deadcode][deadcode] -keepClassName | Passed to [mangle][mangle] & [deadcode][deadcode] -tdz | Passed to [builtIns][builtIns], [evaluate][evaluate], [deadcode][deadcode], [removeUndefined][removeUndefined] - -**Examples** - -```json -{ - "presets": [["minify", { - "evaluate": false, - "mangle": true - }]] -} -``` - -```json -{ - "presets": [["minify", { - "mangle": { - "exclude": ["ParserError", "NetworkError"] - } - }]] -} -``` - -```json -{ - "presets": [["minify", { - "keepFnName": true - }]] -} -// is the same as -{ - "presets": [["minify", { - "mangle": { - "keepFnName": true - }, - "deadcode": { - "keepFnName": true - } - }]] -} -``` - -[booleans]: babel-plugin-transform-minify-booleans -[builtIns]: babel-plugin-minify-builtins -[consecutiveAdds]: babel-plugin-transform-inline-consecutive-adds -[deadcode]: babel-plugin-minify-dead-code-elimination -[evaluate]: babel-plugin-minify-constant-folding -[flipComparisons]: babel-plugin-minify-flip-comparisons -[guards]: babel-plugin-minify-guarded-expressions -[infinity]: babel-plugin-minify-infinity -[mangle]: babel-plugin-minify-mangle-names -[memberExpressions]: babel-plugin-transform-member-expression-literals -[mergeVars]: babel-plugin-transform-merge-sibling-variables -[numericLiterals]: babel-plugin-minify-numeric-literals -[propertyLiterals]: babel-plugin-transform-property-literals -[regexpConstructors]: babel-plugin-transform-regexp-constructors -[removeConsole]: babel-plugin-transform-remove-console -[removeDebugger]: babel-plugin-transform-remove-debugger -[removeUndefined]: babel-plugin-transform-remove-undefined -[replace]: babel-plugin-minify-replace -[simplify]: babel-plugin-minify-simplify -[simplifyComparisons]: babel-plugin-transform-simplify-comparison-operators -[typeConstructors]: babel-plugin-minify-type-constructors -[undefinedToVoid]: babel-plugin-transform-undefined-to-void - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) diff --git a/website/versioned_docs/version-7.8.0/preset-react.md b/website/versioned_docs/version-7.8.0/preset-react.md deleted file mode 100644 index 5dc6426f98..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-react.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: version-7.8.0-babel-preset-react -title: @babel/preset-react -sidebar_label: react -original_id: babel-preset-react ---- - -This preset always includes the following plugins: - -- [@babel/plugin-syntax-jsx](plugin-syntax-jsx.md) -- [@babel/plugin-transform-react-jsx](plugin-transform-react-jsx.md) -- [@babel/plugin-transform-react-display-name](plugin-transform-react-display-name.md) - -And with the `development` option: - -- [@babel/plugin-transform-react-jsx-self](plugin-transform-react-jsx-self.md) -- [@babel/plugin-transform-react-jsx-source](plugin-transform-react-jsx-source.md) - -> Note: Flow syntax support is no longer enabled in v7. For that, you will need to add the [Flow preset](preset-flow.md). - -## Installation - -> You can also check out the React [Getting Started page](https://facebook.github.io/react/docs/hello-world.html) - -```sh -npm install --save-dev @babel/preset-react -``` - -## Usage - -### With a configuration file (Recommended) - -Without options: - -```json -{ - "presets": ["@babel/preset-react"] -} -``` - -With options: - -```json -{ - "presets": [ - [ - "@babel/preset-react", - { - "pragma": "dom", // default pragma is React.createElement - "pragmaFrag": "DomFrag", // default is React.Fragment - "throwIfNamespace": false // defaults to true - } - ] - ] -} -``` - -### Via CLI - -```sh -babel --presets @babel/preset-react script.js -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-react"], -}); -``` - -## Options - -### `pragma` - -`string`, defaults to `React.createElement`. - -Replace the function used when compiling JSX expressions. - -### `pragmaFrag` - -`string`, defaults to `React.Fragment`. - -Replace the component used when compiling JSX fragments. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Will use the native built-in instead of trying to polyfill behavior for any plugins that require one. - -### `useSpread` - -`boolean`, defaults to `false`. - -When spreading props, use inline object with spread elements directly instead of Babel's extend helper or `Object.assign`. - -### `development` - -`boolean`, defaults to `false`. - -Toggles plugins that aid in development, such as [`@babel/plugin-transform-react-jsx-self`](plugin-transform-react-jsx-self.md) and [`@babel/plugin-transform-react-jsx-source`](plugin-transform-react-jsx-source.md). - -This is useful when combined with the [env option](options.md#env) configuration or [js config files](config-files.md#javascript). - -### `throwIfNamespace` - -`boolean`, defaults to `true`. - -Toggles whether or not to throw an error if a XML namespaced tag name is used. For example: - - - -Though the JSX spec allows this, it is disabled by default since React's JSX does not currently have support for it. - -#### .babelrc.js - -```js -module.exports = { - presets: [ - [ - "@babel/preset-react", - { - development: process.env.BABEL_ENV === "development", - }, - ], - ], -}; -``` - -#### .babelrc - -> Note: the `env` option will likely get deprecated soon - -```json -{ - "presets": ["@babel/preset-react"], - "env": { - "development": { - "presets": [["@babel/preset-react", { "development": true }]] - } - } -} -``` - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) diff --git a/website/versioned_docs/version-7.8.0/preset-stage-0.md b/website/versioned_docs/version-7.8.0/preset-stage-0.md deleted file mode 100644 index 1d14488799..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-stage-0.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: version-7.8.0-babel-preset-stage-0 -title: @babel/preset-stage-0 -sidebar_label: stage-0 -original_id: babel-preset-stage-0 ---- - -> As of Babel v7, all the stage presets have been deprecated. -> Check [the blog post](/blog/2018/07/27/removing-babels-stage-presets) for more information. -> -> For upgrade instructions, see [the README](https://github.com/babel/babel/blob/master/packages/babel-preset-stage-0/README.md). - -## Install - -```sh -npm install --save-dev @babel/preset-stage-0 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-stage-0"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-stage-0 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-stage-0"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -Enable "loose" transformations for any plugins in this preset that allow them. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Will use the native built-in instead of trying to polyfill behavior for any plugins that require one. - -### `decoratorsLegacy` - -`boolean`, defaults to `false`. - -Use the legacy (stage 1) decorators syntax and behavior. - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) diff --git a/website/versioned_docs/version-7.8.0/preset-stage-1.md b/website/versioned_docs/version-7.8.0/preset-stage-1.md deleted file mode 100644 index 46e0e5eefe..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-stage-1.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: version-7.8.0-babel-preset-stage-1 -title: @babel/preset-stage-1 -sidebar_label: stage-1 -original_id: babel-preset-stage-1 ---- - -> As of Babel v7, all the stage presets have been deprecated. -> Check [the blog post](/blog/2018/07/27/removing-babels-stage-presets) for more information. -> -> For upgrade instructions, see [the README](https://github.com/babel/babel/blob/master/packages/babel-preset-stage-1/README.md). - -The gist of Stage 1 is: - -> **Stage 1**: proposal -> -> **What is it?** A formal proposal for the feature. -> -> **What’s required?** A so-called champion must be identified who is responsible for the proposal. Either the champion or a co-champion must be a member of TC39 (source). The problem solved by the proposal must be described in prose. The solution must be described via examples, an API and a discussion of semantics and algorithms. Lastly, potential obstacles for the proposal must be identified, such as interactions with other features and implementation challenges. Implementation-wise, polyfills and demos are needed. -> -> **What’s next?** By accepting a proposal for stage 1, TC39 declares its willingness to examine, discuss and contribute to the proposal. Going forward, major changes to the proposal are expected - -## Install - -```sh -npm install --save-dev @babel/preset-stage-1 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-stage-1"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-stage-1 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-stage-1"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -Enable "loose" transformations for any plugins in this preset that allow them. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Will use the native built-in instead of trying to polyfill behavior for any plugins that require one. - -### `decoratorsLegacy` - -`boolean`, defaults to `false`. - -Use the legacy (stage 1) decorators syntax and behavior. - -## References - -- Chapter "[The TC39 process for ECMAScript features](http://exploringjs.com/es2016-es2017/ch_tc39-process.html)" in "Exploring ES2016 and ES2017" by Axel Rauschmayer - diff --git a/website/versioned_docs/version-7.8.0/preset-stage-2.md b/website/versioned_docs/version-7.8.0/preset-stage-2.md deleted file mode 100644 index ab4c723302..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-stage-2.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: version-7.8.0-babel-preset-stage-2 -title: @babel/preset-stage-2 -sidebar_label: stage-2 -original_id: babel-preset-stage-2 ---- - -> As of Babel v7, all the stage presets have been deprecated. -> Check [the blog post](/blog/2018/07/27/removing-babels-stage-presets) for more information. -> -> For upgrade instructions, see [the README](https://github.com/babel/babel/blob/master/packages/babel-preset-stage-2/README.md). - -The gist of Stage 2 is: - -> **Stage 2:** draft -> -> **What is it?** A first version of what will be in the specification. At this point, an eventual inclusion of the feature in the standard is likely. -> -> **What’s required?** The proposal must now additionally have a formal description of the syntax and semantics of the feature (using the formal language of the ECMAScript specification). The description should be as complete as possible, but can contain todos and placeholders. Two experimental implementations of the feature are needed, but one of them can be in a transpiler such as Babel. -> -> **What’s next?** Only incremental changes are expected from now on. - -## Install - -```sh -npm install --save-dev @babel/preset-stage-2 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-stage-2"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-stage-2 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-stage-2"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -Enable "loose" transformations for any plugins in this preset that allow them. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Will use the native built-in instead of trying to polyfill behavior for any plugins that require one. - -### `decoratorsLegacy` - -`boolean`, defaults to `false`. - -Use the legacy (stage 1) decorators syntax and behavior. - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) - -## References - -- Chapter "[The TC39 process for ECMAScript features](http://exploringjs.com/es2016-es2017/ch_tc39-process.html)" in "Exploring ES2016 and ES2017" by Axel Rauschmayer - diff --git a/website/versioned_docs/version-7.8.0/preset-stage-3.md b/website/versioned_docs/version-7.8.0/preset-stage-3.md deleted file mode 100644 index 3a7ae0c278..0000000000 --- a/website/versioned_docs/version-7.8.0/preset-stage-3.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: version-7.8.0-babel-preset-stage-3 -title: @babel/preset-stage-3 -sidebar_label: stage-3 -original_id: babel-preset-stage-3 ---- - -> As of Babel v7, all the stage presets have been deprecated. -> Check [the blog post](/blog/2018/07/27/removing-babels-stage-presets) for more information. -> -> For upgrade instructions, see [the README](https://github.com/babel/babel/blob/master/packages/babel-preset-stage-3/README.md). - -The gist of Stage 3 is: - -> **Stage 3**: candidate -> -> **What is it?** The proposal is mostly finished and now needs feedback from implementations and users to progress further. - -> **What’s required?** The spec text must be complete. Designated reviewers (appointed by TC39, not by the champion) and the ECMAScript spec editor must sign off on the spec text. There must be at least two spec-compliant implementations (which don’t have to be enabled by default). -> -> **What’s next?** Henceforth, changes should only be made in response to critical issues raised by the implementations and their use. - -## Install - -```sh -npm install --save-dev @babel/preset-stage-3 -``` - -## Usage - -### With a configuration file (Recommended) - -```json -{ - "presets": ["@babel/preset-stage-3"] -} -``` - -### Via CLI - -```sh -babel script.js --presets @babel/preset-stage-3 -``` - -### Via Node API - -```javascript -require("@babel/core").transform("code", { - presets: ["@babel/preset-stage-3"] -}); -``` - -## Options - -### `loose` - -`boolean`, defaults to `false`. - -Enable "loose" transformations for any plugins in this preset that allow them. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -Will use the native built-in instead of trying to polyfill behavior for any plugins that require one. - -> You can read more about configuring preset options [here](https://babeljs.io/docs/en/presets#preset-options) - -## References - -- Chapter "[The TC39 process for ECMAScript features](http://exploringjs.com/es2016-es2017/ch_tc39-process.html)" in "Exploring ES2016 and ES2017" by Axel Rauschmayer -