Created
November 3, 2014 04:27
-
-
Save wangzuo/47733c1622935a92a624 to your computer and use it in GitHub Desktop.
gulp locales
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var concat = require('gulp-concat'); | |
var declare = require('gulp-declare'); | |
var rename = require('gulp-rename'); | |
var locales = ['nb_NO', 'nn_NO']; | |
locales.forEach(function(locale) { | |
gulp.task(locale, function() { | |
return gulp.src('builds/locales/'+locale+'.json') | |
.pipe(declare({ | |
namespace: 'RE.locales', | |
noRedeclare: true | |
})) | |
.pipe(rename(locale+'.js')) | |
.pipe(gulp.dest('builds/locales')); | |
}); | |
gulp.task('moment-'+locale, [locale], function() { | |
return gulp.src(['js/libs/moment.js', 'builds/locales/'+locale+'.js', | |
'langs/moment.'+locale+'.js']) | |
.pipe(concat(locale+'.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('builds/locales')); | |
}); | |
}); | |
gulp.task('locales', locales.map(function(locale) { | |
return 'moment-' + locale; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment