Skip to content

Commit 4df456e

Browse files
committed
stash
1 parent 70ed774 commit 4df456e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

development/webpack/utils/loaders/swcLoader.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,14 @@ export default function swcLoader(this: Context, src: string, srcMap?: string) {
181181
...pluginOptions,
182182
envName: this.mode,
183183
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,
184+
// some files in node_modules claim to have sourcemaps when they do
185+
// not[0], and SWC has a bug where logs to stderror if it tries to use a
186+
// sourcemap that does not exist[1]. So we disable sourcemaps for
187+
// node_modules. Ideally, we would not disable them, as they *are* useful
188+
// for debugging.
189+
// [0]: https://github.com/trezor/trezor-suite/issues/20298
190+
// [1]: https://github.com/swc-project/swc/issues/9416
191+
inputSourceMap: false, // this.resourcePath.includes(`${sep}node_modules${sep}`) ? false : srcMap,
193192
sourceFileName: this.resourcePath,
194193
sourceMaps: this.sourceMap,
195194
swcrc: false,

development/webpack/webpack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ const config = {
343343
test: /\.(?:ts|mts|tsx)$/u,
344344
exclude: NODE_MODULES_RE,
345345
use: [
346+
tsxLoader,
346347
{
347348
loader: reactCompilerLoader,
348349
options: defineReactCompilerLoaderOption(reactCompilerOptions),
349350
},
350-
tsxLoader,
351351
codeFenceLoader,
352352
],
353353
},
@@ -356,11 +356,11 @@ const config = {
356356
test: /\.(?:js|mjs|jsx)$/u,
357357
exclude: NODE_MODULES_RE,
358358
use: [
359+
jsxLoader,
359360
{
360361
loader: reactCompilerLoader,
361362
options: defineReactCompilerLoaderOption(reactCompilerOptions),
362363
},
363-
jsxLoader,
364364
codeFenceLoader,
365365
],
366366
},

0 commit comments

Comments
 (0)