|
1 |
| -/** |
2 |
| - * This is override for https://github.com/lodash/babel-plugin-lodash/issues/259. |
3 |
| - * babel-plugin-lodash is using deprecated babel API, which causes generation of many |
4 |
| - * console.trace calls. |
5 |
| - */ |
6 |
| - |
7 |
| -const consoleTrace = console.trace.bind(console); |
8 |
| -console.trace = (message, ...optionalParams) => { |
9 |
| - if ( |
10 |
| - typeof message === 'string' && |
11 |
| - message.startsWith('`isModuleDeclaration` has been deprecated') |
12 |
| - ) { |
13 |
| - return undefined; // noop |
14 |
| - } |
15 |
| - |
16 |
| - return consoleTrace(message, ...optionalParams); |
17 |
| -}; |
18 |
| - |
19 | 1 | module.exports = {
|
20 | 2 | env: {
|
21 | 3 | commonjs: {
|
| 4 | + browserslistEnv: 'isomorphic-production', |
22 | 5 | presets: [
|
23 | 6 | [
|
24 | 7 | '@babel/preset-env',
|
25 | 8 | {
|
26 | 9 | debug: false,
|
27 | 10 | modules: 'commonjs',
|
28 |
| - corejs: { version: 3 }, |
| 11 | + loose: true, |
29 | 12 | useBuiltIns: false,
|
30 |
| - targets: { |
31 |
| - node: '12.20.0', |
32 |
| - }, |
33 | 13 | forceAllTransforms: false,
|
34 |
| - ignoreBrowserslistConfig: true, |
| 14 | + ignoreBrowserslistConfig: false, |
35 | 15 | },
|
36 | 16 | ],
|
37 | 17 | ],
|
38 | 18 | plugins: [
|
39 | 19 | [
|
40 |
| - '@babel/plugin-transform-modules-commonjs', |
| 20 | + '@babel/plugin-transform-runtime', |
41 | 21 | {
|
42 |
| - loose: true, |
| 22 | + corejs: { version: 3, proposals: false }, |
| 23 | + absoluteRuntime: false, |
| 24 | + helpers: true, |
| 25 | + regenerator: false, |
| 26 | + version: '^7.22.15', |
43 | 27 | },
|
44 | 28 | ],
|
45 |
| - '@babel/proposal-class-properties', |
46 |
| - '@babel/proposal-object-rest-spread', |
47 | 29 | ],
|
48 | 30 | },
|
49 | 31 | es: {
|
| 32 | + browserslistEnv: 'isomorphic-production', |
50 | 33 | presets: [
|
51 | 34 | [
|
52 | 35 | '@babel/preset-env',
|
53 | 36 | {
|
54 | 37 | debug: false,
|
55 | 38 | modules: false,
|
56 |
| - corejs: { version: 3 }, |
57 | 39 | useBuiltIns: false,
|
| 40 | + forceAllTransforms: false, |
| 41 | + ignoreBrowserslistConfig: false, |
58 | 42 | },
|
59 | 43 | ],
|
60 | 44 | ],
|
61 | 45 | plugins: [
|
62 | 46 | [
|
63 | 47 | '@babel/plugin-transform-runtime',
|
64 | 48 | {
|
| 49 | + corejs: { version: 3, proposals: false }, |
65 | 50 | absoluteRuntime: false,
|
66 |
| - corejs: 3, |
67 |
| - version: '^7.11.2', |
| 51 | + helpers: true, |
| 52 | + regenerator: false, |
| 53 | + useESModules: true, |
| 54 | + version: '^7.22.15', |
68 | 55 | },
|
69 | 56 | ],
|
70 |
| - '@babel/proposal-class-properties', |
71 |
| - '@babel/proposal-object-rest-spread', |
72 |
| - 'lodash', |
73 | 57 | ],
|
74 | 58 | },
|
75 | 59 | browser: {
|
| 60 | + browserslistEnv: 'browser-production', |
76 | 61 | sourceType: 'unambiguous', // https://github.com/webpack/webpack/issues/4039#issuecomment-419284940
|
77 | 62 | presets: [
|
78 | 63 | [
|
79 | 64 | '@babel/preset-env',
|
80 | 65 | {
|
81 | 66 | debug: false,
|
82 |
| - corejs: { version: 3 }, |
| 67 | + modules: 'auto', |
83 | 68 | useBuiltIns: false,
|
| 69 | + forceAllTransforms: false, |
| 70 | + ignoreBrowserslistConfig: false, |
84 | 71 | },
|
85 | 72 | ],
|
86 | 73 | ],
|
87 | 74 | plugins: [
|
88 | 75 | [
|
89 | 76 | '@babel/plugin-transform-runtime',
|
90 | 77 | {
|
91 |
| - corejs: 3, |
92 |
| - version: '^7.11.2', |
| 78 | + corejs: { version: 3, proposals: false }, |
| 79 | + absoluteRuntime: false, |
| 80 | + helpers: true, |
| 81 | + regenerator: false, |
| 82 | + version: '^7.22.15', |
93 | 83 | },
|
94 | 84 | ],
|
95 |
| - '@babel/proposal-class-properties', |
96 |
| - '@babel/proposal-object-rest-spread', |
97 |
| - 'lodash', |
98 | 85 | ],
|
99 | 86 | },
|
100 | 87 | },
|
|
0 commit comments