Skip to content

Commit

Permalink
Inline configuration of babel-plugin-debug-macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jun 17, 2019
1 parent ada1733 commit 0017ade
Showing 1 changed file with 40 additions and 33 deletions.
73 changes: 40 additions & 33 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,45 +383,52 @@ module.exports = {
_getDebugMacroPlugins(config) {
let addonOptions = config['ember-cli-babel'] || {};

if (addonOptions.disableDebugTooling) { return; }
if (addonOptions.disableDebugTooling) {
return;
}

const isProduction = process.env.EMBER_ENV === 'production';
const isDebug = !isProduction;

let options1 = {
flags: [
return [
[
require.resolve('babel-plugin-debug-macros'),
{
source: '@glimmer/env',
flags: { DEBUG: isDebug, CI: !!process.env.CI }
}
flags: [
{
source: '@glimmer/env',
flags: { DEBUG: isDebug, CI: !!process.env.CI },
},
],

externalizeHelpers: {
global: 'Ember',
},

debugTools: {
isDebug,
source: '@ember/debug',
assertPredicateIndex: 1,
},
},
'@ember/debug stripping',
],
[
require.resolve('babel-plugin-debug-macros'),
{
// deprecated import path https://github.com/emberjs/ember.js/pull/17926#issuecomment-484987305
externalizeHelpers: {
global: 'Ember',
},

debugTools: {
isDebug,
source: '@ember/application/deprecations',
assertPredicateIndex: 1,
},
},
'@ember/application/deprecations stripping',
],

externalizeHelpers: {
global: 'Ember'
},

debugTools: {
isDebug,
source: '@ember/debug',
assertPredicateIndex: 1
}
};

let options2 = { // deprecated import path https://github.com/emberjs/ember.js/pull/17926#issuecomment-484987305
externalizeHelpers: {
global: 'Ember'
},

debugTools: {
isDebug,
source: '@ember/application/deprecations',
assertPredicateIndex: 1
}
};

return [
[require.resolve('babel-plugin-debug-macros'), options1, '@ember/debug stripping'],
[require.resolve('babel-plugin-debug-macros'), options2, '@ember/application/deprecations stripping']
];
},

Expand Down

0 comments on commit 0017ade

Please sign in to comment.