module.exports = function (grunt) { 'use strict'; var _this = this; var configBridge = { "config": { "autoprefixerBrowsers": [ "Android 2.3", "Android >= 4", "Chrome >= 20", "Firefox >= 24", "Explorer >= 8", "iOS >= 6", "Opera >= 12", "Safari >= 6" ] } } grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), theme: { name: "stimulus", version: "1.0" }, banner: '/*!\n' + ' * Bootstrap and Bootstrap essentials Theme compiler v<%= pkg.version %> (<%= pkg.homepage %>)\n' + ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + ' * Licensed under the <%= pkg.license %> license\n' + ' */\n', copy: { bs: { files: [{ expand: true, cwd: 'src/themes/<%= theme.name %>/bootstrap/', src: ['_variables.scss', '_custom.scss'], dest: 'node_modules/bootstrap-sass/assets/stylesheets/bootstrap/' }], }, bse: { files: [{ expand: true, cwd: 'src/themes/<%= theme.name %>/bootstrap-essentials/', src: ['_variables.scss', '_custom.scss'], dest: 'node_modules/bootstrap-essentials/scss/' }, { expand: true, cwd: 'src/themes/<%= theme.name %>/bootstrap/', src: ['_variables.scss'], dest: 'node_modules/bootstrap-essentials/scss/bootstrap' }], } }, sass: { // Task bs: { // Target options: { // Target options style: 'expanded', loadPath: 'node_modules/bootstrap-sass/assets/stylesheets' }, files: { 'assets/css/<%= theme.name %>-bootstrap.css': 'src/themes/common/bootstrap.scss' } }, bse: { // Target options: { // Target options style: 'expanded', loadPath: 'node_modules/bootstrap-essentials/scss' }, files: { 'assets/css/<%= theme.name %>-bootstrap-essentials.css': 'src/themes/common/bootstrap-essentials.scss' } } }, cssmin: { bs: { options: { banner: '' }, files: { 'assets/css/<%= theme.name %>-bootstrap.min.css': ['assets/css/<%= theme.name %>-bootstrap.css'] } }, bse: { options: { banner: '' }, files: { 'assets/css/<%= theme.name %>-bootstrap-essentials.min.css': ['assets/css/<%= theme.name %>-bootstrap-essentials.css'] } } }, csslint: { options: { csslintrc: 'node_modules/bootstrap-essentials/scss/.csslintrc' }, bs: ['assets/css/<%= theme.name %>-bootstrap.css'], bse: ['assets/css/<%= theme.name %>-bootstrap-essentials.css'] }, csscomb: { options: { config: 'node_modules/bootstrap-essentials/scss/.csscomb.json' }, dist: { expand: true, cwd: 'assets/css/', src: ['*.css', '!*.min.css'], dest: 'assets/css/' } }, autoprefixer: { options: { browsers: configBridge.config.autoprefixerBrowsers }, bs: { options: { map: true }, src: 'assets/css/<%= theme.name %>-bootstrap.css' }, bse: { options: { map: true }, src: 'assets/css/<%= theme.name %>-bootstrap-essentials.css' } } }); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-csscomb'); grunt.loadNpmTasks('grunt-contrib-csslint'); grunt.loadNpmTasks('grunt-autoprefixer'); grunt.registerTask('default', ['copy', 'sass', 'autoprefixer', 'cssmin', 'csscomb']); };