File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ UglifyJsPlugin.prototype.apply = function(compiler) {
2020 var options = this . options ;
2121 var requestShortener = this . requestShortener ;
2222 compiler . plugin ( "compilation" , function ( compilation ) {
23+ compilation . plugin ( "build-module" , function ( module ) {
24+ // to get detailed location info about errors
25+ module . useSourceMap = true ;
26+ } ) ;
2327 compilation . plugin ( "optimize-chunk-assets" , function ( chunks , callback ) {
2428 var files = [ ] ;
2529 chunks . forEach ( function ( chunk ) {
@@ -41,11 +45,11 @@ UglifyJsPlugin.prototype.apply = function(compiler) {
4145 return ;
4246 }
4347 var inputSourceMap = compilation . assets [ file ] . map ( ) ;
44- var sourceMap = new SourceMapConsumer ( inputSourceMap )
48+ var sourceMap = new SourceMapConsumer ( inputSourceMap ) ;
4549 uglify . AST_Node . warn_function = function ( warning ) {
4650 var match = / \[ .+ : ( [ 0 - 9 ] + ) , ( [ 0 - 9 ] + ) \] / . exec ( warning ) ;
47- var line = match [ 1 ] ;
48- var column = match [ 2 ] ;
51+ var line = + match [ 1 ] ;
52+ var column = + match [ 2 ] ;
4953 var original = sourceMap . originalPositionFor ( {
5054 line : line ,
5155 column : column
You can’t perform that action at this time.
0 commit comments