Skip to content

Commit afe9436

Browse files
committed
Add SRI build task
1 parent 220ab79 commit afe9436

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

Gruntfile.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,23 @@ module.exports = function(grunt) {
192192
src: '**',
193193
dest: 'dist/'
194194
}
195+
},
196+
197+
sri: {
198+
dist: {
199+
src: ['dist/*.js'],
200+
options: {
201+
dest: 'dist/sri.json',
202+
pretty: true
203+
}
204+
},
205+
build: {
206+
src: ['build/**/*.js'],
207+
options: {
208+
dest: 'build/sri.json',
209+
pretty: true
210+
}
211+
}
195212
}
196213
};
197214

@@ -245,13 +262,14 @@ module.exports = function(grunt) {
245262
grunt.loadNpmTasks('grunt-release');
246263
grunt.loadNpmTasks('grunt-s3');
247264
grunt.loadNpmTasks('grunt-gitinfo');
265+
grunt.loadNpmTasks('grunt-sri');
248266

249267
// Build tasks
250268
grunt.registerTask('_prep', ['clean', 'gitinfo', 'version']);
251269
grunt.registerTask('concat.core', ['_prep', 'concat:core']);
252270
grunt.registerTask('concat.all', ['_prep', 'concat:all']);
253-
grunt.registerTask('build.core', ['concat.core', 'uglify', 'fixSourceMaps']);
254-
grunt.registerTask('build.all', ['concat.all', 'uglify', 'fixSourceMaps']);
271+
grunt.registerTask('build.core', ['concat.core', 'uglify', 'fixSourceMaps', 'sri:dist']);
272+
grunt.registerTask('build.all', ['concat.all', 'uglify', 'fixSourceMaps', 'sri:dist', 'sri:build']);
255273
grunt.registerTask('build', ['build.all']);
256274
grunt.registerTask('dist', ['build.core', 'copy:dist']);
257275

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"docs",
1515
"package.json",
1616
"example",
17-
"test"
17+
"test",
18+
"dist/sri.json"
1819
]
1920
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"main": "dist/raven.js",
1515
"devDependencies": {
1616
"chai": "~1.8.1",
17-
"grunt": "~0.4.1",
17+
"grunt": "^0.4.5",
1818
"grunt-cli": "~0.1.9",
1919
"grunt-contrib-clean": "~0.4.0",
2020
"grunt-contrib-concat": "~0.3.0",
@@ -26,6 +26,7 @@
2626
"grunt-mocha": "~0.4.1",
2727
"grunt-release": "~0.6.0",
2828
"grunt-s3": "~0.2.0-alpha.3",
29+
"grunt-sri": "mattrobenolt/grunt-sri#pretty",
2930
"jquery": "^2.1.4",
3031
"lodash": "~2.4.0",
3132
"sinon": "~1.7.3"

0 commit comments

Comments
 (0)