patternlibrary/Gruntfile.js

81 lines
2.6 KiB
JavaScript
Raw Normal View History

2018-06-21 01:38:13 +00:00
module.exports = function (grunt) {
grunt.initConfig({
sass: {
dev: {
options: {
style: 'compact'
},
files: {
'agaric/css/agaric.css': 'agaric/sass/agaric.scss'
2018-06-21 01:38:13 +00:00
}
}
},
assemble: {
dev: {
options: {
flatten: true,
2018-08-20 13:40:53 +00:00
data: 'static-layouts/design-source/data/*.{json,yml}',
2018-06-21 01:38:13 +00:00
layout: false,
2018-08-20 13:40:53 +00:00
partials: 'static-layouts/design-source/templates/**/*.hbs'
2018-06-21 01:38:13 +00:00
},
files: [
{
expand: true,
2018-08-20 13:40:53 +00:00
cwd: 'static-layouts/design-source/pages',
2018-06-21 01:38:13 +00:00
src: '**/*.{hbs,md}',
2018-08-20 13:40:53 +00:00
dest: 'static-layouts/design-output/'
2018-06-21 01:38:13 +00:00
}
]
}
},
2018-08-20 13:40:53 +00:00
clean: ['static-layouts/design-output/*.html'],
2018-06-21 01:38:13 +00:00
connect: {
preview: {
options: {
base: ['./'],
port: 9000,
hostname: 'localhost',
keepalive: false,
livereload: 35729,
2018-08-20 13:40:53 +00:00
open: 'http://0.0.0.0:9000/static-layouts/design-output'
2018-06-21 01:38:13 +00:00
}
}
},
watch: {
templates: {
files: [
2018-08-20 13:40:53 +00:00
'static-layouts/design-source/templates/**/*.{hbs,md}',
'static-layouts/design-source/pages/**/*.{hbs,md}',
'static-layouts/design-source/data/**/*.json',
'agaric/sass/**/*.scss',
2018-06-21 01:38:13 +00:00
],
tasks: ['assemble','sass:dev']
},
livereload: {
options: {
livereload: '<%= connect.preview.options.livereload %>'
},
2018-08-20 13:40:53 +00:00
files: ['static-layouts/design-output/**.*']
2018-06-21 01:38:13 +00:00
}
},
shell: {
target: {
2018-08-20 13:40:53 +00:00
command: './node_modules/.bin/kss --config styleguide/_source/styleguide-config.json --verbose'
2018-06-21 01:38:13 +00:00
}
}
});
grunt.loadNpmTasks('assemble');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-kss');
grunt.registerTask('kss',['shell']);
grunt.registerTask('build', ['clean', 'assemble', 'sass:dev']);
grunt.registerTask('server', ['build','connect','watch']);
grunt.registerTask('default', ['server']);
};