Skip to content

Commit

Permalink
fix: provide name option to babel caller config
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Feb 28, 2020
1 parent e1744ce commit 266af4d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,19 @@ export default function(source: string): string {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const markoCompiler = require((queryOptions && queryOptions.compiler) ||
DEFAULT_COMPILER);
const babelOptions = Object.assign(
const babelConfig = Object.assign(
{},
queryOptions && queryOptions.babelOptions
queryOptions && queryOptions.babelConfig
);
babelOptions.caller = Object.assign(
babelConfig.caller = Object.assign(
{
name: "@marko/webpack/loader",
target: this.target,
supportsStaticESM: true,
supportsDynamicImport: true,
supportsTopLevelAwait: true
},
babelOptions.caller
babelConfig.caller
);

const dependenciesOnly = this.resource.endsWith("?dependencies");
Expand Down Expand Up @@ -109,7 +110,7 @@ export default function(source: string): string {
writeToDisk: false,
requireTemplates: true,
writeVersionComment: false,
babelOptions
babelConfig
}
);
} else if (hydrate) {
Expand All @@ -132,7 +133,7 @@ export default function(source: string): string {
writeToDisk: false,
writeVersionComment: false,
sourceMaps,
babelOptions
babelConfig
}
);

Expand Down Expand Up @@ -214,7 +215,7 @@ export default function(source: string): string {
requireTemplates: true,
writeVersionComment: false,
sourceMaps,
babelOptions
babelConfig
}
);

Expand Down

0 comments on commit 266af4d

Please sign in to comment.