Skip to content

Commit d5aaae5

Browse files
committed
Build: Fixed sourceMap by removing the leading "dist/"
Added a linefeed at the end of the minified copyright Whitespace changes
1 parent 45ffb10 commit d5aaae5

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

Gruntfile.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function( grunt ) {
2424
"",
2525
"",
2626
"" ].join( grunt.util.linefeed ),
27-
minified: "/*! jQuery Mobile <%= version %> | (c) 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */"
27+
minified: "/*! jQuery Mobile <%= version %> | (c) 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */\n"
2828
};
2929

3030
// grunt plugins
@@ -144,13 +144,13 @@ module.exports = function( grunt ) {
144144
options: {
145145
banner: banner.minified,
146146
sourceMap: path.join( dist, name ) + ".min.map",
147-
sourceMappingURL: "./" + name + ".min.map",
147+
sourceMappingURL: name + ".min.map",
148148
beautify: {
149149
ascii_only: true
150150
}
151151
},
152152
files: {
153-
"dist/jquery.mobile.min.js": path.join( dist, name ) + ".js",
153+
"dist/jquery.mobile.min.js": path.join( dist, name ) + ".js"
154154
}
155155
}
156156
},
@@ -175,7 +175,7 @@ module.exports = function( grunt ) {
175175
//inlining. The value of this option should be a string of comma separated
176176
//CSS file names to ignore (like 'a.css,b.css'. The file names should match
177177
//whatever strings are used in the @import calls.
178-
cssImportIgnore: null,
178+
cssImportIgnore: null
179179
},
180180
all: {
181181
files: {
@@ -283,6 +283,21 @@ module.exports = function( grunt ) {
283283
dest: path.join( dist, "demos/" )
284284
},
285285
]
286+
},
287+
sourcemap: {
288+
// Processes the sourceMap to fix issue: https://github.com/mishoo/UglifyJS2/issues/47
289+
options: {
290+
processContent: function( content, srcPath ) {
291+
content = content.replace( /"dist\//g, "\"" );
292+
return content;
293+
}
294+
},
295+
files: [
296+
{
297+
src: "<%= uglify.all.options.sourceMap %>",
298+
dest: "<%= uglify.all.options.sourceMap %>"
299+
}
300+
]
286301
}
287302
},
288303

@@ -400,7 +415,7 @@ module.exports = function( grunt ) {
400415
"jquery.mobile.structure-<%= pkg.version %>.css": path.join( dist, "jquery.mobile.structure.css" ),
401416
"jquery.mobile.structure-<%= pkg.version %>.min.css": path.join( dist, "jquery.mobile.structure.min.css" ),
402417
"jquery.mobile.structure-<%= pkg.version %>.zip": path.join( dist, "jquery.mobile.structure.min.css" )
403-
}
418+
}
404419
},
405420
latest: {
406421
files: {
@@ -432,7 +447,7 @@ module.exports = function( grunt ) {
432447

433448
grunt.registerTask( "lint", [ "jshint" ] );
434449

435-
grunt.registerTask( "js:release", [ "requirejs", "concat:js", "uglify" ] );
450+
grunt.registerTask( "js:release", [ "requirejs", "concat:js", "uglify", "copy:sourcemap" ] );
436451
grunt.registerTask( "js", [ "config:dev", "js:release" ] );
437452

438453
grunt.registerTask( "css:release", [ "cssbuild", "cssmin" ] );
@@ -443,7 +458,6 @@ module.exports = function( grunt ) {
443458
grunt.registerTask( "dist:release", [ "js:release", "css:release", "copy:images", "demos", "compress:dist" ] );
444459
grunt.registerTask( "dist", [ "config:dev", "dist:release" ] );
445460

446-
447461
grunt.registerTask( "test", [ "config:dev", "requirejs", "connect", "qunit:http" ] );
448462
grunt.registerTask( "test:ci", [ "qunit_junit", "connect", "qunit:http" ] );
449463

0 commit comments

Comments
 (0)