question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sourcemaps seem to break when replacing "ngInject" prologues.

See original GitHub issue

I noticed if I use this loader to replace the “ngInject”; prologues my source maps no longer open the original file.

{
	loader: 'string-replace-loader',
	options: {
		multiple: [
			{
				search: /["']ngInject["'];*/,
				replace: '',
				flags: 'g'
			}
		]
	}
},
{
    loader: 'ng-annotate-loader'
},
{
	loader: 'babel-loader',
	options: {
		cacheDirectory: true
	}
},

Perhaps I’m missing something? If I take out the string-replace-loader source maps are okay again.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
donaldpipowitchcommented, Jun 6, 2017

@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.

0reactions
snipkingcommented, May 26, 2017

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')
            }
      ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't find javascript source map to debug in chrome devtools
However, I can't seem to actually find the source map so that I can place a break point. I can't find it in...
Read more >
purescript | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Overview - TypeScript
TypeScript 3.4 can now produce generic function types when inference from other generic functions produces free type variables for inferences. This means many ......
Read more >
Software self-defense systems and methods - Google Patents
The signature of a program can also be changed by replacing instructions and/or ... the source map will often appear quite random; by...
Read more >
d3n8a8pro7vhmx.cloudfront.net/themes/5654d01801925...
//This can still fail, but catches the most reasonable //uses of .. break; ... utils":32,"source-map":38}],10:[function(require,module,exports){ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found