|
1 | | -import { sep } from 'node:path'; |
2 | 1 | import type { LoaderContext } from 'webpack'; |
3 | 2 | import { type JSONSchema7 } from 'schema-utils/declarations/validate'; |
4 | 3 | import { validate } from 'schema-utils'; |
@@ -173,23 +172,15 @@ type SchemaOptions = { keepDefaultedPropertiesOptional: true }; |
173 | 172 | export type SwcLoaderOptions = FromSchema<typeof schema, SchemaOptions>; |
174 | 173 |
|
175 | 174 | type Context = LoaderContext<SwcLoaderOptions>; |
176 | | -export default function swcLoader(this: Context, src: string, srcMap?: string) { |
| 175 | +export default function swcLoader(this: Context, src: string) { |
177 | 176 | const pluginOptions = this.getOptions(); |
178 | 177 | validate(schema, pluginOptions, { name: 'swcLoader' }); |
179 | 178 |
|
180 | 179 | const options: Options = { |
181 | 180 | ...pluginOptions, |
182 | 181 | envName: this.mode, |
183 | 182 | 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, |
193 | 184 | sourceFileName: this.resourcePath, |
194 | 185 | sourceMaps: this.sourceMap, |
195 | 186 | swcrc: false, |
|
0 commit comments