Skip to content

Commit

Permalink
fix(webpack): pass all user resolve options to loader (fixes callstac…
Browse files Browse the repository at this point in the history
  • Loading branch information
5angel committed Sep 2, 2021
1 parent eed92b1 commit 522356b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/webpack5-loader/src/index.ts
Expand Up @@ -32,11 +32,6 @@ export default function webpack5Loader(

EvalCache.clearForFile(this.resourcePath);

const resolveOptionsDefaults = {
conditionNames: ['require'],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
};

const {
sourceMap = undefined,
cacheDirectory = '.linaria-cache',
Expand Down Expand Up @@ -68,12 +63,7 @@ export default function webpack5Loader(
// Another option is to read the webpack.config.js, but it won't work for programmatic usage
// This API is used by many loaders/plugins, so hope we're safe for a while
{
...resolveOptionsDefaults,
...((this._compilation?.options.resolve && {
alias: this._compilation.options.resolve.alias,
modules: this._compilation.options.resolve.modules,
}) ||
{}),
...(this._compilation?.options.resolve ?? {}),
...resolveOptions,
}
);
Expand Down

0 comments on commit 522356b

Please sign in to comment.