Skip to content

Commit

Permalink
Merge pull request #2271 from powerfulyang/master
Browse files Browse the repository at this point in the history
feat: swc currently support paths mapping on Windows
  • Loading branch information
kamilmysliwiec authored Aug 31, 2023
2 parents f7124df + 0ccfe08 commit 5446b00
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/compiler/defaults/swc-defaults.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { platform } from 'process';
import * as ts from 'typescript';
import { Configuration } from '../../configuration';

Expand All @@ -11,15 +10,6 @@ export const swcDefaultsFactory = (
? configuration?.compilerOptions?.builder?.options
: {};

// swc does not currently support paths mapping on Windows
// see https://github.com/nestjs/nest-cli/issues/2211
const pathsMappingOptions = platform?.startsWith('win')
? {}
: {
baseUrl: tsOptions?.baseUrl,
paths: tsOptions?.paths,
};

return {
swcOptions: {
module: {
Expand All @@ -38,7 +28,8 @@ export const swcDefaultsFactory = (
useDefineForClassFields: false,
},
keepClassNames: true,
...pathsMappingOptions,
baseUrl: tsOptions?.baseUrl,
paths: tsOptions?.paths,
},
minify: false,
swcrc: true,
Expand Down

0 comments on commit 5446b00

Please sign in to comment.