marco/babel.config.mjs
2026-01-21 13:07:30 +07:00

47 lines
1.0 KiB
JavaScript

import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { setConfig } from '@warp-drive/core/build-config';
import { buildMacros } from '@embroider/macros/babel';
const macros = buildMacros({
configure: (config) => {
setConfig(config, {
// for universal apps this MUST be at least 5.6
compatWith: '5.6',
});
},
});
export default {
plugins: [
[
'babel-plugin-ember-template-compilation',
{
compilerPath: 'ember-source/ember-template-compiler/index.js',
transforms: [...macros.templateMacros],
},
],
[
'module:decorator-transforms',
{
runtime: {
import: import.meta.resolve('decorator-transforms/runtime-esm'),
},
},
],
[
'@babel/plugin-transform-runtime',
{
absoluteRuntime: dirname(fileURLToPath(import.meta.url)),
useESModules: true,
regenerator: false,
},
],
...macros.babelMacros,
],
generatorOpts: {
compact: false,
},
};