Commit ef1ab2c512bd04877581828a713860dfbdc86023
1 parent
91b52f87
Exists in
master
and in
30 other branches
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 | 3 | var path = require('path'); |
| 4 | 4 | var gulp = require('gulp'); |
| 5 | 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 | 8 | var $ = require('gulp-load-plugins')({ |
| 9 | 9 | pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del'] | ... | ... |
gulp/conf.js
| ... | ... | @@ -19,12 +19,14 @@ exports.paths = { |
| 19 | 19 | tmp: '.tmp', |
| 20 | 20 | e2e: 'e2e', |
| 21 | 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 | 32 | * Wiredep is the lib which inject bower dependencies in your project | ... | ... |
index.html.erb
package.json
| ... | ... | @@ -7,8 +7,12 @@ |
| 7 | 7 | "moment": "^2.11.2", |
| 8 | 8 | "ng-forward": "0.0.1-alpha.12" |
| 9 | 9 | }, |
| 10 | + "config": { | |
| 11 | + "theme": "default" | |
| 12 | + }, | |
| 10 | 13 | "scripts": { |
| 11 | 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 | 16 | "webpack": "webpack", |
| 13 | 17 | "karma": "concurrently \"webpack -w\" \"karma start\"", |
| 14 | 18 | "docs": "gulp ngdocs; static-server docs", | ... | ... |