inputSourceMap = true doesn't loaded source map file for swc-loader

Viewed 31

webpack.config.js

{
    test: /\.[jt]sx?$/,
    use: {
        loader: require.resolve('swc-loader'),
        options: {
            parseMap: true,
            sourceMaps: true,
            inputSourceMap: true,
            jsc: {
                ...swcrc.jsc,
            },
        },
    },
},

The project structure is monorepo; suppose the folder is

|-packages
     |-app
     |-components

suppose App.tsx in app package import a component List.tsx from components packages, the List.tsx is compiled to js extension, and its source map file is generated which is included in compiled List.js file;

//# sourceMappingURL=List.js.map

But it doesn't load the source map in components packages. And we cannot debug the source code of List.tsx component source code

0 Answers
Related