Closed derekdon closed 7 years ago
I have the same problem. Currently this plugin breaks sourcemaps, but it should just leave them as it is.
@derekdon @Avol-V which kind of sourcemaps do you use, folks? I guess, this issue is only about inline sourcemaps
No, I use external sourcemaps. There is a parts from my webpack.config.js:
devtool: 'source-map',
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: 'string-replace-loader',
options: {
search: /\b_import\(/g,
replace: 'import(',
},
},
{
loader: 'ts-loader',
options: {
configFileName: './app/tsconfig.json',
}
},
]
}
],
},
Same to me.
devtool: "eval-source-map",
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.tsx?$/,
// loaders: ["babel-loader", "ts-loader"],
use: [
{
loader: 'string-replace-loader',
options: {
search: '_import\\(',
replace: 'import(',
flags: 'g'
}
},
{
loader: 'babel-loader'
},
{
loader: 'ts-loader'
},
],
include: path.join(__dirname, 'src')
}
]
}
@snipking I basically have the same setup like you. I hope my PR will fix this: https://github.com/Va1/string-replace-loader/pull/28.
I noticed if I use this loader to replace the "ngInject"; prologues my source maps no longer open the original file.
Perhaps I'm missing something? If I take out the string-replace-loader source maps are okay again.