Skip to content

Commit

Permalink
fix key
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Mar 22, 2024
1 parent 71604ce commit 721a705
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/macros/src/babel/macros-babel-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ export default function main(context: typeof Babel): unknown {
}
const obj = t.objectExpression(
entries.map(e => {
const key = e.split('.')[0];
const key = e.split('.').slice(-1).join('.');
const id = t.callExpression(
state.importUtil.import(path, state.pathToOurAddon('es-compat2'), 'default', 'esc'),
[state.importUtil.import(path, join(resolvedPath, e).replace(/\\/g, '/'), '*')]
[state.importUtil.import(path, join(resolvedPath, key).replace(/\\/g, '/'), '*')]
);
return t.objectProperty(t.stringLiteral(key), id);
})
Expand Down

0 comments on commit 721a705

Please sign in to comment.