forked from nubasedev/potato
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (34 loc) · 1.17 KB
/
gulpfile.js
File metadata and controls
40 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const gulp = require('gulp');
const rename = require('gulp-rename');
const babel = require("gulp-babel");
const webpack = require('gulp-webpack');
const webpackConfig = require('./webpack.config.demo.prod.js');
const sass = require('gulp-sass');
gulp.task('build_styles', function () {
return gulp.src('./src/styles/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./lib/styles'));
});
// library
gulp.task('copy_styles', function () {
return gulp.src('./src/styles/**/*')
.pipe(gulp.dest('./lib/styles'));
});
gulp.task('build', ['copy_styles', 'build_styles'], function () {
return gulp.src("./src/**/*.js")
.pipe(babel())
.pipe(gulp.dest("./lib"));
});
// demo
// removes the output configuration from the webpack.config.js file, otherwise it doesn't work.
webpackConfig.output.path = null;
gulp.task('copy-index', function () {
return gulp.src('./demo/index.prod.html')
.pipe(rename('index.html'))
.pipe(gulp.dest('./docs'));
});
gulp.task('build-demo', ['copy-index'], function () {
return gulp.src("./demo/client.js")
.pipe(webpack(webpackConfig))
.pipe(gulp.dest('./docs'));
});