Skip to content

Commit

Permalink
feat(new babel config): move babel-plugin-debug-macros to the utility…
Browse files Browse the repository at this point in the history
… so the config is more readable
  • Loading branch information
BlueCutOfficial committed Jul 10, 2024
1 parent 5a640bf commit 8c96c9c
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 168 deletions.
42 changes: 42 additions & 0 deletions packages/compat/src/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,48 @@ export function loadLegacyPlugins() {
return plugins ?? [];
}

export function loadPluginDebugMacros() {
return [
[
'babel-plugin-debug-macros',
{
flags: [
{
source: '@glimmer/env',
flags: {
DEBUG: true,
CI: false,
},
},
],
debugTools: {
isDebug: true,
source: '@ember/debug',
assertPredicateIndex: 1,
},
externalizeHelpers: {
module: '@ember/debug',
},
},
'@ember/debug stripping',
],
[
'babel-plugin-debug-macros',
{
externalizeHelpers: {
module: '@ember/application/deprecations',
},
debugTools: {
isDebug: true,
source: '@ember/application/deprecations',
assertPredicateIndex: 1,
},
},
'@ember/application/deprecations stripping',
],
];
}

function _warnIfNoLegacyPlugins(legacyPlugins: any) {
if (!legacyPlugins || !legacyPlugins.length) {
console.warn(`
Expand Down
2 changes: 1 addition & 1 deletion packages/compat/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { loadLegacyPlugins } from './babel';
export { loadLegacyPlugins, loadPluginDebugMacros } from './babel';
export { default as App } from './compat-app';
export { default as Addons } from './compat-addons';
export { default as Options, recommendedOptions } from './options';
Expand Down
Loading

0 comments on commit 8c96c9c

Please sign in to comment.