|
| 1 | +module.exports = function (api) { |
| 2 | + // const env = api.env() |
| 3 | + // api.cache.using(() => process.env.NODE_ENV === 'development') |
| 4 | + api.cache.never(); |
| 5 | + |
| 6 | + return { |
| 7 | + presets: ['@babel/preset-env', '@babel/preset-react'], |
| 8 | + plugins: [ |
| 9 | + // Stage 0 |
| 10 | + '@babel/plugin-proposal-function-bind', |
| 11 | + |
| 12 | + // Stage 1 |
| 13 | + '@babel/plugin-proposal-export-default-from', |
| 14 | + '@babel/plugin-proposal-logical-assignment-operators', |
| 15 | + ['@babel/plugin-proposal-optional-chaining', { loose: false }], |
| 16 | + ['@babel/plugin-proposal-pipeline-operator', { proposal: 'minimal' }], |
| 17 | + ['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }], |
| 18 | + '@babel/plugin-proposal-do-expressions', |
| 19 | + |
| 20 | + // Stage 2 |
| 21 | + ['@babel/plugin-proposal-decorators', { legacy: true }], |
| 22 | + '@babel/plugin-proposal-function-sent', |
| 23 | + '@babel/plugin-proposal-export-namespace-from', |
| 24 | + '@babel/plugin-proposal-numeric-separator', |
| 25 | + '@babel/plugin-proposal-throw-expressions', |
| 26 | + |
| 27 | + // Stage 3 |
| 28 | + '@babel/plugin-syntax-dynamic-import', |
| 29 | + '@babel/plugin-syntax-import-meta', |
| 30 | + ['@babel/plugin-proposal-class-properties', { loose: false }], |
| 31 | + '@babel/plugin-proposal-json-strings', |
| 32 | + ], |
| 33 | + }; |
| 34 | +}; |
0 commit comments