forked from GovAlta/ui-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel-preset.js
More file actions
52 lines (52 loc) · 1.94 KB
/
Copy pathbabel-preset.js
File metadata and controls
52 lines (52 loc) · 1.94 KB
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
43
44
45
46
47
48
49
50
51
52
/*
* This is a customized version of the NX @web preset, because in vue projects the caller is undefined
*/
module.exports = function (api, options) {
api.assertVersion(7);
return {
presets: [
// Support module/nomodule pattern.
[
require.resolve('@babel/preset-env'),
{
// Allow importing core-js in entrypoint and use browserlist to select polyfills.
// This is needed for differential loading as well.
useBuiltIns: 'entry',
corejs: 3,
// Do not transform modules to CJS
modules: false,
targets: { esmodules: true },
bugfixes: true,
// Exclude transforms that make all code slower
exclude: ['transform-typeof-symbol'],
},
],
require.resolve('@babel/preset-typescript'),
],
plugins: [
require.resolve('babel-plugin-macros'),
// Must use legacy decorators to remain compatible with TypeScript.
[require.resolve('@babel/plugin-proposal-decorators'), { legacy: true }],
[
require.resolve('@babel/plugin-proposal-class-properties'),
{ loose: true },
],
],
overrides: [
// Convert `const enum` to `enum`. The former cannot be supported by babel
// but at least we can get it to not error out.
{
test: /\.tsx?$/,
plugins: [
[
require.resolve('babel-plugin-const-enum'),
{
transform: 'removeConst',
},
],
],
},
],
};
};
//# sourceMappingURL=babel.js.map