passman/Gruntfile.js

114 lines
2.4 KiB
JavaScript
Raw Normal View History

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
html2js: {
options: {
// custom options, see below
2016-09-10 20:02:54 +08:00
base: 'templates',
quoteChar: '\'',
useStrict: true,
htmlmin: {
2016-09-11 05:30:17 +08:00
collapseBooleanAttributes: false,
2016-09-10 20:02:54 +08:00
collapseWhitespace: true,
removeAttributeQuotes: false,
removeComments: true,
removeEmptyAttributes: false,
2016-09-11 05:30:17 +08:00
removeRedundantAttributes: false,
2016-09-10 20:02:54 +08:00
removeScriptTypeAttributes: false,
removeStyleLinkTypeAttributes: false
}
},
main: {
src: ['templates/views/**/*.html'],
dest: 'js/templates.js'
}
},
2016-10-08 01:56:29 +08:00
jshint: {
options: {
curly: false,
eqeqeq: true,
eqnull: true,
browser: true,
globals: {
"angular": true,
"PassmanImporter": true,
2016-10-08 19:26:48 +08:00
"PassmanExporter": true,
2016-10-08 01:56:29 +08:00
"OC": true,
"window": true,
"console": true,
"CRYPTO": true,
"C_Promise": true,
"forge": true,
"sjcl": true,
"jQuery": true,
"$": true,
2016-10-08 01:56:29 +08:00
"_": true,
"oc_requesttoken": true
}
},
all: ['Gruntfile.js', 'js/app/**/*.js']
},
2016-09-10 20:02:54 +08:00
sass: {
dist: {
files: [
{
expand: true,
cwd: "sass",
src: ["**/app.scss"],
dest: "css",
ext: ".css"
2016-10-01 23:21:24 +08:00
},
{
expand: true,
cwd: "sass",
src: ["**/bookmarklet.scss"],
dest: "css",
ext: ".css"
2016-10-03 17:42:19 +08:00
},
{
expand: true,
cwd: "sass",
src: ["**/public-page.scss"],
dest: "css",
ext: ".css"
2016-09-10 20:02:54 +08:00
}
]
}
},
2016-09-15 06:11:59 +08:00
//@TODO JSHint
watch: {
scripts: {
files: ['Gruntfile.js', 'templates/views/{,*/}{,*/}{,*/}*.html', 'templates/views/*.html','sass/*','sass/partials/*'],
2016-09-10 20:02:54 +08:00
tasks: ['html2js','sass'],
options: {
spawn: false,
interrupt: true,
reload: true
}
}
},
// uglify: {
// options: {
// banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
// },
// build: {
// src: 'src/<%= pkg.name %>.js',
// dest: 'build/<%= pkg.name %>.min.js'
// }
// }
});
// Load the plugin that provides the "uglify" task.
2016-09-10 20:02:54 +08:00
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-contrib-watch');
2016-10-08 01:56:29 +08:00
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
2016-09-10 21:26:51 +08:00
grunt.registerTask('default', ['html2js', 'sass']);
2016-10-08 01:56:29 +08:00
grunt.registerTask('hint', ['jshint']);
};