Commit b6916ac93989aac68eb1c584ee703f1d369bfb8b
1 parent
4f0fedbc
Exists in
master
and in
1 other branch
Build dist for all themes
Showing
5 changed files
with
12 additions
and
6 deletions
Show diff stats
gulp/build.js
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | var path = require('path'); | 3 | var path = require('path'); |
4 | var gulp = require('gulp'); | 4 | var gulp = require('gulp'); |
5 | var conf = require('./conf'); | 5 | var conf = require('./conf'); |
6 | -var noosferoThemePrefix = "/designs/themes/angular-theme/dist/"; | 6 | +var noosferoThemePrefix = path.join("/designs/themes/angular-theme", conf.paths.dist, '/'); |
7 | 7 | ||
8 | var $ = require('gulp-load-plugins')({ | 8 | var $ = require('gulp-load-plugins')({ |
9 | pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del'] | 9 | pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del'] |
gulp/conf.js
@@ -19,12 +19,14 @@ exports.paths = { | @@ -19,12 +19,14 @@ exports.paths = { | ||
19 | tmp: '.tmp', | 19 | tmp: '.tmp', |
20 | e2e: 'e2e', | 20 | e2e: 'e2e', |
21 | docs: 'docs', | 21 | docs: 'docs', |
22 | - theme: argv.theme ? path.join('themes', argv.theme) : null | 22 | + themes: 'themes' |
23 | }; | 23 | }; |
24 | -exports.paths.allSources = [exports.paths.src]; | ||
25 | -if(exports.paths.theme) { | ||
26 | - exports.paths.allSources.push(exports.paths.theme); | 24 | +exports.configTheme = function(theme) { |
25 | + exports.paths.theme = path.join(exports.paths.themes, theme || "default"); | ||
26 | + exports.paths.allSources = [exports.paths.src, exports.paths.theme]; | ||
27 | + exports.paths.dist = path.join("dist", exports.paths.theme); | ||
27 | } | 28 | } |
29 | +exports.configTheme(argv.theme); | ||
28 | 30 | ||
29 | /** | 31 | /** |
30 | * Wiredep is the lib which inject bower dependencies in your project | 32 | * Wiredep is the lib which inject bower dependencies in your project |
index.html.erb
package.json
@@ -7,8 +7,12 @@ | @@ -7,8 +7,12 @@ | ||
7 | "moment": "^2.11.2", | 7 | "moment": "^2.11.2", |
8 | "ng-forward": "0.0.1-alpha.12" | 8 | "ng-forward": "0.0.1-alpha.12" |
9 | }, | 9 | }, |
10 | + "config": { | ||
11 | + "theme": "default" | ||
12 | + }, | ||
10 | "scripts": { | 13 | "scripts": { |
11 | "build": "webpack; gulp clean && gulp --theme=$npm_package_config_theme build", | 14 | "build": "webpack; gulp clean && gulp --theme=$npm_package_config_theme build", |
15 | + "build-all": "gulp clean && for d in ./themes/* ; do (gulp --theme=`basename $d` build); done", | ||
12 | "webpack": "webpack", | 16 | "webpack": "webpack", |
13 | "karma": "concurrently \"webpack -w\" \"karma start\"", | 17 | "karma": "concurrently \"webpack -w\" \"karma start\"", |
14 | "docs": "gulp ngdocs; static-server docs", | 18 | "docs": "gulp ngdocs; static-server docs", |