Permalink
Browse files

auto update css on release / dev modes

  • Loading branch information...
born2net committed May 4, 2017
1 parent 0834210 commit b8f288d13271c563db5b47d434274a59aa084303
Showing with 66 additions and 17 deletions.
  1. +39 −0 gulpfile.js
  2. +8 −6 package.json
  3. +19 −11 src/styles/style.css
@@ -2,13 +2,27 @@ var gulp = require('gulp');
var git = require('gulp-git');
var runSequence = require('run-sequence');
var bump = require('gulp-bump');
var replace = require('gulp-replace');
gulp.task('x_bump', function(){
gulp.src('./package.json')
.pipe(bump({type:'PATCH', indent: 4 }))
.pipe(gulp.dest('./'));
});
gulp.task('cssDev', function(){
gulp.src(['src/styles/style.css'])
.pipe(replace(/\/\*\*dev_mode_start\*\*\/[^]+\/\*\*dev_mode_end\*\*\//gim, cssDev))
.pipe(gulp.dest('src/styles/'));
});
gulp.task('cssRelease', function(){
gulp.src(['src/styles/style.css'])
.pipe(replace(/\/\*\*dev_mode_start\*\*\/[^]+\/\*\*dev_mode_end\*\*\//gim, cssRelease))
.pipe(gulp.dest('src/styles/'));
});
/** Dangerous, this will wipe your current source and sync with GitHub **/
gulp.task('vanish***', function (done) {
var c = 8;
@@ -35,3 +49,28 @@ gulp.task('x_gitReset', function () {
if (err) throw err;
});
});
var cssRelease = `/**dev_mode_start**/
small.debug {
color: red;
display: none !important;
}
small.release {
text-transform: lowercase;
color: #4c4c4c;
}
/**dev_mode_end**/`;
var cssDev = `/**dev_mode_start**/
small.debug {
color: red;
}
small.release {
text-transform: lowercase;
color: #4c4c4c;
display: none !important;
}
/**dev_mode_end**/`;
@@ -1,6 +1,6 @@
{
"name": "studioweb",
"version": "0.1.737",
"version": "0.1.740",
"license": "Modified GPL (see readme.md)",
"angular-cli": {},
"scripts": {
@@ -17,16 +17,18 @@
"x_rsync_iw": "rsync --progress --chmod=ug=rwx --chmod=o=rx -av --stats -e ssh /cygdrive/c/msweb/studiolite/dist/ Sean@digitalsignage.com:/var/www/sites/dynasite/htdocs/_msportal/_js/_node/_studioweb/locale/iw",
"x_sw": "sw-precache --root=dist --config=sw-precache-config.js",
"x_bump": "gulp x_bump",
"x_cssDev": "gulp cssDev",
"x_cssRelease": "gulp cssRelease",
"x_translate": "node_modules/.bin/ng-xi18n -p src/tsconfig.json --i18nFormat=xmb",
"x_node_copy": "cp -r -f ./node_modules/ ./dist/out-tsc/",
"cp module": "cp ./node_modules/ng-mslib/src/myng-component.ts ./node_modules/ng-mslib/dist/",
"generate_locale": "npm run x_node_copy && npm run x_translate",
"hmr": "ng serve --port 4208 --aot false --hmr -e=hmr",
"dev": "ng serve --port 4208 --aot false",
"release_aot_hebrew": "rm -r -f ./dist && npm run x_bump && npm run x_prod_aot_hebrew && npm run x_sw && npm run x_rsync_iw",
"release_aot": "rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync",
"release_aot_no_sync": "rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw",
"release_jit": "rm -r -f ./dist && npm run x_bump && npm run x_prod_jit && npm run x_sw && npm run x_rsync"
"dev": "npm run x_cssDev && ng serve --port 4208 --aot false",
"release_aot_hebrew": "npm run x_cssRelease && rm -r -f ./dist && npm run x_bump && npm run x_prod_aot_hebrew && npm run x_sw && npm run x_rsync_iw",
"release_aot": "npm run x_cssRelease && rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync",
"release_aot_no_sync": "npm run x_cssRelease && rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw",
"release_jit": "npm run x_cssRelease && rm -r -f ./dist && npm run x_bump && npm run x_prod_jit && npm run x_sw && npm run x_rsync"
},
"dependencies": {
"@angular/animations": "^4.1.0",
@@ -639,17 +639,6 @@ small {
display: block;
}
small.debug {
color: red;
display: none !important;
}
small.release {
text-transform: lowercase;
color: #4c4c4c;
/*display: none !important;*/
}
.panel-title {
font-size: 0.9em;
}
@@ -1593,3 +1582,22 @@ div.kineticjs-content {
opacity: 1 !important;
}
/**dev_mode_start**/
small.debug {
color: red;
}
small.release {
text-transform: lowercase;
color: #4c4c4c;
display: none !important;
}
/**dev_mode_end**/

0 comments on commit b8f288d

Please sign in to comment.