Skip to content

Commit

Permalink
Allow user webpack config to override internal config
Browse files Browse the repository at this point in the history
  • Loading branch information
apellerano-pw authored and ef4 committed May 21, 2022
1 parent 37d112a commit eaeb05f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/ember-auto-import/ts/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ export default class Bundler extends Plugin {

get bundlerHook(): BundlerHook {
if (!this.cachedBundlerHook) {
const internalWebpackConfig: any = {};
if ([...this.options.packages.values()].find(pkg => pkg.forbidsEval)) {
internalWebpackConfig.devtool = 'source-map';
}
let extraWebpackConfig = mergeWith(
{},
internalWebpackConfig,
...[...this.options.packages.values()].map(pkg => pkg.webpackConfig),
(objValue: any, srcValue: any) => {
// arrays concat
Expand All @@ -86,9 +90,6 @@ export default class Bundler extends Plugin {
}
}
);
if ([...this.options.packages.values()].find(pkg => pkg.forbidsEval)) {
extraWebpackConfig.devtool = 'source-map';
}
debug('extraWebpackConfig %j', extraWebpackConfig);
this.cachedBundlerHook = new WebpackBundler(
this.options.bundles,
Expand Down

0 comments on commit eaeb05f

Please sign in to comment.