mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-19 17:21:50 +03:00
Merge pull request #51 from acdha/generate-source-maps
Generate source maps
This commit is contained in:
commit
57d438cf88
24
Gruntfile.js
24
Gruntfile.js
@ -10,6 +10,7 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks("grunt-contrib-watch");
|
||||
grunt.loadNpmTasks("grunt-contrib-clean");
|
||||
grunt.loadNpmTasks("grunt-git-describe");
|
||||
grunt.loadNpmTasks('grunt-text-replace');
|
||||
|
||||
// ----------
|
||||
var packageJson = grunt.file.readJSON("package.json"),
|
||||
@ -77,9 +78,27 @@ module.exports = function(grunt) {
|
||||
dest: distribution
|
||||
}
|
||||
},
|
||||
replace: {
|
||||
cleanPaths: {
|
||||
src: ['build/openseadragon/*.map'],
|
||||
overwrite: true,
|
||||
replacements: [
|
||||
{
|
||||
from: /build\/openseadragon\//g,
|
||||
to: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
preserveComments: "some"
|
||||
preserveComments: "some",
|
||||
sourceMap: function (filename) {
|
||||
return filename.replace(/\.js$/, '.js.map');
|
||||
},
|
||||
sourceMappingURL: function (filename) {
|
||||
return filename.replace(/\.js$/, '.js.map').replace('build/openseadragon/', '');
|
||||
},
|
||||
},
|
||||
openseadragon: {
|
||||
src: [ distribution ],
|
||||
@ -190,7 +209,8 @@ module.exports = function(grunt) {
|
||||
// Build task.
|
||||
// Cleans out the build folder and builds the code and images into it, checking lint.
|
||||
grunt.registerTask("build", [
|
||||
"clean:build", "jshint:beforeconcat", "git-describe", "concat", "jshint:afterconcat", "uglify", "copy:build"
|
||||
"clean:build", "jshint:beforeconcat", "git-describe", "concat", "jshint:afterconcat",
|
||||
"uglify", "replace:cleanPaths", "copy:build"
|
||||
]);
|
||||
|
||||
// ----------
|
||||
|
@ -7,12 +7,13 @@
|
||||
"grunt-contrib-compress": "~0.5.0",
|
||||
"grunt-contrib-concat": "~0.1.2",
|
||||
"grunt-contrib-jshint": "~0.1.1",
|
||||
"grunt-contrib-uglify": "~0.1.1",
|
||||
"grunt-contrib-uglify": "~0.2.2",
|
||||
"grunt-contrib-qunit": "~0.2.0",
|
||||
"grunt-contrib-connect": "~0.1.2",
|
||||
"grunt-contrib-watch": "~0.2.0",
|
||||
"grunt-contrib-clean": "~0.4.0",
|
||||
"grunt-git-describe": "~2.0.0"
|
||||
"grunt-git-describe": "~2.0.0",
|
||||
"grunt-text-replace": "~0.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
|
Loading…
x
Reference in New Issue
Block a user