Skip to content

Commit

Permalink
fix(webpack): add previours rules before adding new
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Jan 19, 2023
1 parent d5b12db commit 384d2a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/webpack/src/utils/with-nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export function withNx(opts?: { skipTypeChecking?: boolean }) {
profile: options.statsJson,
resolve: {
...config.resolve,
extensions,
extensions: [...extensions, ...(config?.resolve?.extensions ?? [])],
alias: options.fileReplacements.reduce(
(aliases, replacement) => ({
...aliases,
Expand All @@ -175,7 +175,7 @@ export function withNx(opts?: { skipTypeChecking?: boolean }) {
plugins: [
new TsconfigPathsPlugin({
configFile: options.tsConfig,
extensions,
extensions: [...extensions, ...(config?.resolve?.extensions ?? [])],
mainFields,
}),
],
Expand Down Expand Up @@ -231,6 +231,7 @@ export function withNx(opts?: { skipTypeChecking?: boolean }) {
// Enabled for performance
unsafeCache: true,
rules: [
...(config?.module?.rules ?? []),
options.sourceMap && {
test: /\.js$/,
enforce: 'pre' as const,
Expand Down

0 comments on commit 384d2a9

Please sign in to comment.