From 518000d2cb9cda9d8822dd3cc84722224adacf1b Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 8 Mar 2014 18:47:15 +0200 Subject: [PATCH] Refactor Gruntfile.js targets. --- Gruntfile.js | 53 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6287a25..2d3a39b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -68,13 +68,21 @@ module.exports = function (grunt) { style: 'expanded', unixNewlines: true }, - dist: { - files: { - '<%= meta.distPath %>css/<%= pkg.name %>.css': 'sass/ratchet.scss', - '<%= meta.distPath %>css/<%= pkg.name %>-theme-ios.css': 'sass/theme-ios.scss', - '<%= meta.distPath %>css/<%= pkg.name %>-theme-android.css': 'sass/theme-android.scss', - '<%= meta.docsAssetsPath %>css/docs.css': 'sass/docs.scss' - } + core: { + src: 'sass/ratchet.scss', + dest: '<%= meta.distPath %>css/<%= pkg.name %>.css' + }, + android: { + src: 'sass/theme-android.scss', + dest: '<%= meta.distPath %>css/<%= pkg.name %>-theme-android.css' + }, + ios: { + src: 'sass/theme-ios.scss', + dest: '<%= meta.distPath %>css/<%= pkg.name %>-theme-ios.css' + }, + docs: { + src: 'sass/docs.scss', + dest: '<%= meta.docsAssetsPath %>css/docs.css' } }, @@ -82,16 +90,24 @@ module.exports = function (grunt) { options: { config: 'sass/.csscomb.json' }, - dist: { + core: { + files: { + '<%= sass.core.dest %>': '<%= sass.core.dest %>' + } + }, + android: { + files: { + '<%= sass.android.dest %>': '<%= sass.android.dest %>' + } + }, + ios: { files: { - '<%= meta.distPath %>css/<%= pkg.name %>.css': '<%= meta.distPath %>css/<%= pkg.name %>.css', - '<%= meta.distPath %>css/<%= pkg.name %>-theme-android.css': '<%= meta.distPath %>css/<%= pkg.name %>-theme-android.css', - '<%= meta.distPath %>css/<%= pkg.name %>-theme-ios.css': '<%= meta.distPath %>css/<%= pkg.name %>-theme-ios.css' + '<%= sass.ios.dest %>': '<%= sass.ios.dest %>' } }, docs: { files: { - '<%= meta.docsAssetsPath %>css/docs.css': '<%= meta.docsAssetsPath %>css/docs.css' + '<%= sass.docs.dest %>': '<%= sass.docs.dest %>' } } }, @@ -126,9 +142,9 @@ module.exports = function (grunt) { ] }, core: { - src: '<%= meta.distPath %>css/<%= pkg.name %>.css' + src: '<%= sass.core.dest %>' }, - android_theme: { + android: { options: { browsers: [ 'Android 2.3', @@ -138,18 +154,15 @@ module.exports = function (grunt) { 'Opera >= 12' ] }, - src: '<%= sass.android_theme.dest %>' + src: '<%= sass.android.dest %>' }, - ios_theme: { + ios: { options: { browsers: ['iOS >= 6'] }, - src: '<%= sass.ios_theme.dest %>' + src: '<%= sass.ios.dest %>' }, docs: { - options: { - browsers: ['last 2 versions', 'ie 9', 'android 2.3', 'android 4', 'opera 12'] - }, src: '<%= sass.docs.dest %>' } },