Skip to content

Commit 20b99b9

Browse files
committed
Set swc loader inputSourceMap to false
1 parent 190a4e6 commit 20b99b9

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

development/webpack/utils/loaders/swcLoader.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { sep } from 'node:path';
21
import type { LoaderContext } from 'webpack';
32
import { type JSONSchema7 } from 'schema-utils/declarations/validate';
43
import { validate } from 'schema-utils';
@@ -173,23 +172,15 @@ type SchemaOptions = { keepDefaultedPropertiesOptional: true };
173172
export type SwcLoaderOptions = FromSchema<typeof schema, SchemaOptions>;
174173

175174
type Context = LoaderContext<SwcLoaderOptions>;
176-
export default function swcLoader(this: Context, src: string, srcMap?: string) {
175+
export default function swcLoader(this: Context, src: string) {
177176
const pluginOptions = this.getOptions();
178177
validate(schema, pluginOptions, { name: 'swcLoader' });
179178

180179
const options: Options = {
181180
...pluginOptions,
182181
envName: this.mode,
183182
filename: this.resourcePath,
184-
inputSourceMap:
185-
// some files in node_modules claim to have sourcemaps when they do
186-
// not[0], and SWC has a bug where logs to stderror if it tries to use a
187-
// sourcemap that does not exist[1]. So we disable sourcemaps for
188-
// node_modules. Ideally, we would not disable them, as they *are* useful
189-
// for debugging.
190-
// [0]: https://github.com/trezor/trezor-suite/issues/20298
191-
// [1]: https://github.com/swc-project/swc/issues/9416
192-
this.resourcePath.includes(`${sep}node_modules${sep}`) ? false : srcMap,
183+
inputSourceMap: false,
193184
sourceFileName: this.resourcePath,
194185
sourceMaps: this.sourceMap,
195186
swcrc: false,

0 commit comments

Comments
 (0)