-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
preset-stage-0.ts
42 lines (39 loc) 路 1007 Bytes
/
preset-stage-0.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import presetStage1 from "./preset-stage-1";
import { proposalFunctionBind } from "./generated/plugins";
export default (_: any, opts: any = {}) => {
const {
loose = false,
useBuiltIns = false,
decoratorsLegacy = false,
pipelineProposal = "minimal",
importAssertionsVersion = "september-2020",
} = opts;
if (!process.env.BABEL_8_BREAKING) {
// eslint-disable-next-line no-var
var { decoratorsBeforeExport } = opts;
}
return {
presets: [
[
presetStage1,
process.env.BABEL_8_BREAKING
? {
loose,
useBuiltIns,
decoratorsLegacy,
pipelineProposal,
importAssertionsVersion,
}
: {
loose,
useBuiltIns,
decoratorsLegacy,
decoratorsBeforeExport,
pipelineProposal,
importAssertionsVersion,
},
],
],
plugins: [proposalFunctionBind],
};
};