Skip to content

Commit

Permalink
Remove from standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 11, 2021
1 parent cd4d22d commit fa70f22
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/babel-standalone/examples/example.htm
Expand Up @@ -31,7 +31,7 @@
[
"stage-0",
{
decoratorsBeforeExport: false,
pipelineProposal: "fsharp",
},
],
],
Expand Down
30 changes: 21 additions & 9 deletions packages/babel-standalone/src/preset-stage-0.js
Expand Up @@ -7,23 +7,35 @@ export default (_: any, opts: Object = {}) => {
loose = false,
useBuiltIns = false,
decoratorsLegacy = false,
decoratorsBeforeExport,
pipelineProposal = "minimal",
importAssertionsVersion = "september-2020",
} = opts;

if (!process.env.BABEL_8_BREAKING) {
// eslint-disable-next-line no-var
var { decoratorsBeforeExport } = opts;
}

return {
presets: [
[
presetStage1,
{
loose,
useBuiltIns,
decoratorsLegacy,
decoratorsBeforeExport,
pipelineProposal,
importAssertionsVersion,
},
process.env.BABEL_8_BREAKING
? {
loose,
useBuiltIns,
decoratorsLegacy,
pipelineProposal,
importAssertionsVersion,
}
: {
loose,
useBuiltIns,
decoratorsLegacy,
decoratorsBeforeExport,
pipelineProposal,
importAssertionsVersion,
},
],
],
plugins: [proposalFunctionBind],
Expand Down
10 changes: 8 additions & 2 deletions packages/babel-standalone/src/preset-stage-1.js
Expand Up @@ -7,16 +7,22 @@ export default (_: any, opts: Object = {}) => {
loose = false,
useBuiltIns = false,
decoratorsLegacy = false,
decoratorsBeforeExport,
pipelineProposal = "minimal",
recordAndTupleSyntax: recordAndTupleSyntax = "hash",
} = opts;

if (!process.env.BABEL_8_BREAKING) {
// eslint-disable-next-line no-var
var { decoratorsBeforeExport } = opts;
}

return {
presets: [
[
presetStage2,
{ loose, useBuiltIns, decoratorsLegacy, decoratorsBeforeExport },
process.env.BABEL_8_BREAKING
? { loose, useBuiltIns, decoratorsLegacy }
: { loose, useBuiltIns, decoratorsLegacy, decoratorsBeforeExport },
],
],
plugins: [
Expand Down
16 changes: 9 additions & 7 deletions packages/babel-standalone/src/preset-stage-2.js
Expand Up @@ -3,20 +3,22 @@ import presetStage3 from "./preset-stage-3";
import * as babelPlugins from "./generated/plugins";

export default (_: any, opts: Object = {}) => {
const {
loose = false,
useBuiltIns = false,
decoratorsLegacy = false,
decoratorsBeforeExport,
} = opts;
const { loose = false, useBuiltIns = false, decoratorsLegacy = false } = opts;

if (!process.env.BABEL_8_BREAKING) {
// eslint-disable-next-line no-var
var { decoratorsBeforeExport } = opts;
}

return {
presets: [[presetStage3, { loose, useBuiltIns }]],
plugins: [
babelPlugins.proposalClassStaticBlock,
[
babelPlugins.proposalDecorators,
{ legacy: decoratorsLegacy, decoratorsBeforeExport },
process.env.BABEL_8_BREAKING
? { legacy: decoratorsLegacy }
: { legacy: decoratorsLegacy, decoratorsBeforeExport },
],
babelPlugins.proposalFunctionSent,
babelPlugins.proposalPrivatePropertyInObject,
Expand Down

0 comments on commit fa70f22

Please sign in to comment.