Browse Source

Merge branch 'rtl/build' of https://github.com/MohammadYounes/Semantic-UI into next

pull/1615/head
jlukic 10 years ago
parent
commit
7b3919f789
3 changed files with 60 additions and 3 deletions
  1. 59
      gulpfile.js
  2. 1
      package.json
  3. 3
      tasks/gulp-settings.js

59
gulpfile.js

@ -40,6 +40,7 @@ var
prompt = require('gulp-prompt'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
rtlcss = require('gulp-rtlcss'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify'),
util = require('gulp-util'),
@ -417,6 +418,40 @@ gulp.task('build', 'Builds all files from source', function(callback) {
});
gulp.task('build-rtl', 'Builds rtl css from release files', function (callback) {
var
stream
;
console.info('Building Semantic RTL');
// unified css stream
stream = gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map|*.rtl).css')
.pipe(plumber())
.pipe(rtlcss())
.pipe(rename(settings.rename.rtlCSS))
.pipe(gulp.dest(output.uncompressed))
.pipe(print(log.created))
.on('end', function () {
gulp.start('package uncompressed rtl css');
})
;
stream
.pipe(plumber())
.pipe(clone())
.pipe(minifyCSS(settings.minify))
.pipe(rename(settings.rename.minCSS))
.pipe(gulp.dest(output.compressed))
.pipe(print(log.created))
.on('end', function () {
callback();
gulp.start('package compressed rtl css');
})
;
});
// cleans distribution files
gulp.task('clean', 'Clean dist folder', function(callback) {
return del([clean], settings.del, callback);
@ -431,7 +466,7 @@ gulp.task('version', 'Displays current version of Semantic', function(callback)
---------------*/
gulp.task('package uncompressed css', false, function() {
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map).css')
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map|*.rtl).css')
.pipe(plumber())
.pipe(replace(assetPaths.uncompressed, assetPaths.packaged))
.pipe(concatCSS('semantic.css'))
@ -441,8 +476,17 @@ gulp.task('package uncompressed css', false, function() {
;
});
gulp.task('package uncompressed rtl css', false, function () {
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map).rtl.css')
.pipe(replace(assetPaths.uncompressed, assetPaths.packaged))
.pipe(concatCSS('semantic.rtl.css'))
.pipe(gulp.dest(output.packaged))
.pipe(print(log.created))
;
});
gulp.task('package compressed css', false, function() {
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map).css')
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map|*.rtl).css')
.pipe(plumber())
.pipe(replace(assetPaths.uncompressed, assetPaths.packaged))
.pipe(concatCSS('semantic.min.css'))
@ -454,6 +498,17 @@ gulp.task('package compressed css', false, function() {
;
});
gulp.task('package compressed rtl css', false, function () {
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map).rtl.css')
.pipe(replace(assetPaths.uncompressed, assetPaths.packaged))
.pipe(concatCSS('semantic.rtl.min.css'))
.pipe(minifyCSS(settings.minify))
.pipe(header(banner, settings.header))
.pipe(gulp.dest(output.packaged))
.pipe(print(log.created))
;
});
gulp.task('package uncompressed js', false, function() {
return gulp.src(output.uncompressed + '**/' + componentGlob + '!(*.min|*.map).js')
.pipe(plumber())

1
package.json

@ -48,6 +48,7 @@
"gulp-prompt": "^0.1.1",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.0",
"gulp-rtlcss": "^0.1.2",
"gulp-sourcemaps": "^1.2.8",
"gulp-uglify": "^1.0.1",
"gulp-util": "^3.0.1",

3
tasks/gulp-settings.js

@ -41,7 +41,8 @@ module.exports = {
rename: {
json : { extname : '.json' },
minJS : { extname : '.min.js' },
minCSS : { extname : '.min.css' }
minCSS : { extname : '.min.css' },
rtlCSS : { extname : '.rtl.css' },
},
wrench: {
recursive: {

Loading…
Cancel
Save