Skip to content

Commit

Permalink
Merge pull request #1245 from stevcooo/do-not-use-absolute-path-in-ve…
Browse files Browse the repository at this point in the history
…ndor-files

Do not use absolute path in vendor files
  • Loading branch information
ef4 authored Aug 31, 2022
2 parents 788931f + 8150fff commit e017581
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/macros/src/babel/macros-babel-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function main(context: typeof Babel): unknown {
FunctionDeclaration: {
enter(path: NodePath<t.FunctionDeclaration>, state: State) {
let id = path.get('id');
if (id.isIdentifier() && id.node.name === 'initializeRuntimeMacrosConfig') {
if (id.isIdentifier() && id.node.name === 'initializeRuntimeMacrosConfig' && state.opts.mode === 'run-time') {
let pkg = state.owningPackage();
if (pkg && pkg.name === '@embroider/macros') {
inlineRuntimeConfig(path, state, context);
Expand Down
4 changes: 2 additions & 2 deletions packages/macros/tests/babel/get-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe(`getConfig`, function () {
});
}

test('inlines runtime config into own source', () => {
runTimeTest('inlines runtime config into own source', () => {
filename = __filename;
let code = transform(`
function initializeRuntimeMacrosConfig() {
Expand All @@ -171,7 +171,7 @@ describe(`getConfig`, function () {
expect(run(code, { filename }).packages[coreRoot].beverage).toEqual('coffee');
});

test('does not inline runtime config into other packages', () => {
runTimeTest('does not inline runtime config into other packages', () => {
let code = transform(`
function initializeRuntimeMacrosConfig() {
}
Expand Down

0 comments on commit e017581

Please sign in to comment.