-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
debug-macros.js
43 lines (39 loc) · 1.12 KB
/
debug-macros.js
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
'use strict';
const Babel = require('broccoli-babel-transpiler');
const FEATURES = require('./features');
module.exports = function debugMacros(tree, environment) {
let isDebug = environment !== 'production';
let plugins = [
[
'debug-macros',
{
debugTools: {
source: '@ember/debug',
assertPredicateIndex: 1,
isDebug,
},
externalizeHelpers: {
module: true,
},
flags: [
{ source: '@glimmer/env', flags: { DEBUG: isDebug } },
{
source: '@ember/canary-features',
flags: Object.assign(
// explicit list of additional exports within @ember/canary-features
// without adding this (with a null value) an error is thrown during
// the feature replacement process (e.g. XYZ is not a supported flag)
{
FEATURES: null,
DEFAULT_FEATURES: null,
isEnabled: null,
},
FEATURES
),
},
],
},
],
];
return new Babel(tree, { plugins });
};