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 Jun 23, 2021
1 parent 35938c0 commit faf85ff
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.ts
Expand Up @@ -6,23 +6,35 @@ export default (_: any, opts: any = {}) => {
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.ts
Expand Up @@ -6,16 +6,22 @@ export default (_: any, opts: any = {}) => {
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.ts
Expand Up @@ -2,20 +2,22 @@ import presetStage3 from "./preset-stage-3";
import * as babelPlugins from "./generated/plugins";

export default (_: any, opts: any = {}) => {
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 faf85ff

Please sign in to comment.