-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.cjs
More file actions
54 lines (48 loc) · 1.09 KB
/
babel.config.cjs
File metadata and controls
54 lines (48 loc) · 1.09 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
53
54
/**
* Copyright IBM Corp. 2020, 2026
*/
/**
* This babel.config is not used for publishing.
* It's only for the local editing experience
* (and linting)
*/
const { buildMacros } = require('@embroider/macros/babel');
const {
babelCompatSupport,
templateCompatSupport,
} = require('@embroider/compat/babel');
const macros = buildMacros();
// For scenario testing
const isCompat = Boolean(process.env.ENABLE_COMPAT_BUILD);
module.exports = {
plugins: [
[
'@babel/plugin-transform-typescript',
{
allExtensions: true,
allowDeclareFields: true,
onlyRemoveTypeImports: true,
},
],
[
'babel-plugin-ember-template-compilation',
{
transforms: [
...(isCompat ? templateCompatSupport() : macros.templateMacros),
],
},
],
[
'module:decorator-transforms',
{
runtime: {
import: require.resolve('decorator-transforms/runtime-esm'),
},
},
],
...(isCompat ? babelCompatSupport() : macros.babelMacros),
],
generatorOpts: {
compact: false,
},
};