Commit 82e933cd 82e933cd3df05f7bb5b8af0a6dd7870d069a24a7 by Vincent Peybernes

Add gulpfile.js

1 parent 5d31b59a
1 const srcPath = './lib/relative-placement.js';
2 const distPath = './dist/';
3 var gulp = require('gulp');
4 var babel = require('gulp-babel');
5 var replace = require('gulp-replace');
6 var rename = require('gulp-rename');
7 var del = require('del');
8 var package = require('./package.json');
9 gulp.task('default', ['build']);
10 gulp.task('build',['clean'], ()=>{
11 return gulp.src(srcPath)
12 .pipe(replace(/RelativePlacement.version = '.+?';/, 'RelativePlacement.version = \''+package.version+'\';'))
13 .pipe(gulp.dest(distPath))
14 .pipe(babel({
15 presets: ['es2015']
16 }))
17 .pipe(rename(path => {
18 path.basename += '-es2015'
19 }))
20 .pipe(gulp.dest(distPath));
21 });
22 gulp.task('clean',() => {
23 return del(distPath);
24 });
...\ No newline at end of file ...\ No newline at end of file