Skip to content

Commit

Permalink
fix: default resolve roots
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Apr 23, 2024
1 parent 432ce5e commit 9a3b6bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/rspack/src/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const applyRspackOptionsDefaults = (

options.resolve = cleverMerge(
getResolveDefaults({
context: options.context!,
targetProperties,
mode: options.mode,
css: options.experiments.css!
Expand Down Expand Up @@ -833,10 +834,12 @@ const getResolveLoaderDefaults = () => {
// The values are aligned with webpack
// https://github.com/webpack/webpack/blob/b9fb99c63ca433b24233e0bbc9ce336b47872c08/lib/config/defaults.js#L1431
const getResolveDefaults = ({
context,
targetProperties,
mode,
css
}: {
context: string;
targetProperties: any;
mode?: Mode;
css: boolean;
Expand Down Expand Up @@ -884,6 +887,7 @@ const getResolveDefaults = ({
extensions: [],
aliasFields: [],
exportsFields: ["exports"],
roots: [context],
mainFields: ["main"],
byDependency: {
wasm: esmDeps(),
Expand Down

0 comments on commit 9a3b6bb

Please sign in to comment.