ratchet/Gruntfile.js

93 строки
2.3 KiB
JavaScript
Исходник Обычный вид История

2013-09-11 22:01:13 +04:00
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
2014-02-16 23:09:47 +04:00
distPath: 'dist/',
docsPath: 'docs/dist/',
docsAssetsPath: 'docs/assets/'
},
2013-09-12 01:24:02 +04:00
banner: '/*\n' +
2013-10-12 23:11:34 +04:00
' * =====================================================\n' +
' * Ratchet v<%= pkg.version %>\n' +
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
' *\n' +
2014-02-24 08:12:40 +04:00
' * Designed by @connors.\n' +
2013-10-12 23:11:34 +04:00
' * =====================================================\n' +
' */\n',
2013-09-12 01:58:52 +04:00
concat: {
2013-09-11 22:01:13 +04:00
options: {
2013-09-13 08:44:18 +04:00
banner: '<%= banner %>'
2013-09-11 22:01:13 +04:00
},
2013-09-12 01:58:52 +04:00
ratchet: {
src: [
2014-02-16 23:09:47 +04:00
'js/modals.js',
'js/popovers.js',
'js/push.js',
'js/segmented-controllers.js',
'js/sliders.js',
'js/toggles.js'
2013-09-12 01:58:52 +04:00
],
dest: '<%= meta.distPath %><%= pkg.name %>.js'
2014-02-16 23:09:47 +04:00
},
docs: {
src: '<%= meta.distPath %><%= pkg.name %>.js',
dest: '<%= meta.docsPath %><%= pkg.name %>.js'
2013-09-11 22:01:13 +04:00
}
2013-09-12 01:58:52 +04:00
},
2013-09-11 23:53:07 +04:00
sass: {
2013-10-12 23:11:34 +04:00
options: {
banner: '<%= banner %>',
style: 'expanded',
},
dist: {
files: {
2014-02-16 23:09:47 +04:00
'<%= meta.distPath %><%= pkg.name %>.css': 'sass/ratchet.scss',
'<%= meta.distPath %>ios-theme.css': 'sass/theme-ios.scss',
'<%= meta.distPath %>android-theme.css': 'sass/theme-android.scss',
2014-02-25 04:31:41 +04:00
'<%= meta.docsAssetsPath %>css/docs.css': 'sass/docs.scss'
}
2013-10-12 23:11:34 +04:00
}
},
2014-02-25 04:31:41 +04:00
copy: {
docs: {
expand: true,
cwd: 'dist',
src: [
'*'
],
dest: 'docs/dist'
}
},
watch: {
2013-10-12 23:11:34 +04:00
scripts: {
files: [
'<%= meta.srcPath %>/**/*.scss'
],
tasks: ['sass']
}
2013-09-11 22:01:13 +04:00
}
});
2013-09-14 02:40:18 +04:00
// Load the plugins
2013-12-22 14:22:59 +04:00
grunt.loadNpmTasks('grunt-contrib-concat');
2014-02-25 04:31:41 +04:00
grunt.loadNpmTasks('grunt-contrib-copy');
2013-09-11 23:31:57 +04:00
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
2013-12-22 14:22:59 +04:00
grunt.loadNpmTasks('grunt-jekyll');
2013-09-11 22:01:13 +04:00
2014-02-25 04:31:41 +04:00
2013-09-11 22:01:13 +04:00
// Default task(s).
2014-02-25 04:31:41 +04:00
grunt.registerTask('default', ['sass', 'concat', 'copy']);
grunt.registerTask('build', ['sass', 'concat', 'copy']);
2013-10-12 23:11:34 +04:00
};