mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
Concatenate Angular templates in minified JS file
This commit is contained in:
parent
ddd976162c
commit
0f6aa3befb
@ -5,7 +5,7 @@ module.exports = function(grunt) {
|
|||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
clean: {
|
clean: {
|
||||||
init: ['dist'],
|
init: ['dist'],
|
||||||
after: ['dist/style.css', 'dist/docs.js', 'dist/share.js', 'dist/less.css', 'dist/app']
|
after: ['dist/style.css', 'dist/docs.js', 'dist/share.js', 'dist/less.css', 'dist/app', 'dist/partial']
|
||||||
},
|
},
|
||||||
ngAnnotate: {
|
ngAnnotate: {
|
||||||
options: {
|
options: {
|
||||||
@ -64,6 +64,44 @@ module.exports = function(grunt) {
|
|||||||
dest: 'dist/share.min.js'
|
dest: 'dist/share.min.js'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ngtemplates: {
|
||||||
|
docs: {
|
||||||
|
cwd: 'src',
|
||||||
|
src: 'partial/docs/*.html',
|
||||||
|
dest: 'dist/docs.min.js',
|
||||||
|
options: {
|
||||||
|
append: true,
|
||||||
|
htmlmin: {
|
||||||
|
collapseBooleanAttributes: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
removeAttributeQuotes: true,
|
||||||
|
removeComments: true,
|
||||||
|
removeEmptyAttributes: true,
|
||||||
|
removeRedundantAttributes: true,
|
||||||
|
removeScriptTypeAttributes: true,
|
||||||
|
removeStyleLinkTypeAttributes: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
share: {
|
||||||
|
cwd: 'src',
|
||||||
|
src: 'partial/share/*.html',
|
||||||
|
dest: 'dist/share.min.js',
|
||||||
|
options: {
|
||||||
|
append: true,
|
||||||
|
htmlmin: {
|
||||||
|
collapseBooleanAttributes: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
removeAttributeQuotes: true,
|
||||||
|
removeComments: true,
|
||||||
|
removeEmptyAttributes: true,
|
||||||
|
removeRedundantAttributes: true,
|
||||||
|
removeScriptTypeAttributes: true,
|
||||||
|
removeStyleLinkTypeAttributes: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
copy: {
|
copy: {
|
||||||
dist: {
|
dist: {
|
||||||
expand: true,
|
expand: true,
|
||||||
@ -118,9 +156,11 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-ng-annotate');
|
grunt.loadNpmTasks('grunt-ng-annotate');
|
||||||
grunt.loadNpmTasks('grunt-text-replace');
|
grunt.loadNpmTasks('grunt-text-replace');
|
||||||
grunt.loadNpmTasks('grunt-apidoc');
|
grunt.loadNpmTasks('grunt-apidoc');
|
||||||
|
grunt.loadNpmTasks('grunt-angular-templates');
|
||||||
|
|
||||||
// Default tasks.
|
// Default tasks.
|
||||||
grunt.registerTask('default', ['clean:init', 'ngAnnotate', 'concat:docs', 'concat:share', 'less', 'concat:css', 'cssmin',
|
grunt.registerTask('default', ['clean:init', 'ngAnnotate', 'concat:docs', 'concat:share', 'less', 'concat:css',
|
||||||
'uglify:docs', 'uglify:share', 'copy', 'clean:after', 'cleanempty', 'htmlrefs:index', 'htmlrefs:share', 'replace', 'apidoc']);
|
'cssmin', 'uglify:docs', 'uglify:share', 'ngtemplates:docs', 'ngtemplates:share', 'copy', 'clean:after',
|
||||||
|
'cleanempty', 'htmlrefs:index', 'htmlrefs:share', 'replace', 'apidoc']);
|
||||||
|
|
||||||
};
|
};
|
@ -37,6 +37,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "^1.0.1",
|
"grunt": "^1.0.1",
|
||||||
|
"grunt-angular-templates": "^1.1.0",
|
||||||
"grunt-apidoc": "^0.11.0",
|
"grunt-apidoc": "^0.11.0",
|
||||||
"grunt-cleanempty": "^1.0.4",
|
"grunt-cleanempty": "^1.0.4",
|
||||||
"grunt-contrib-clean": "^1.0.0",
|
"grunt-contrib-clean": "^1.0.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user