forked from atsukoba/osc-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
41 lines (35 loc) · 1.09 KB
/
gulpfile.js
File metadata and controls
41 lines (35 loc) · 1.09 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
41
const gulp = require('gulp');
const server = require('gulp-express');
const eslint = require('gulp-eslint');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
const autoprefixer = require('gulp-autoprefixer');
const concat = require('gulp-concat');
gulp.task('scss', () => {
gulp.src('./public/stylesheets/scss/style.scss')
.pipe(
sass({
outputStyle: 'expanded'
}))
.pipe(sourcemaps.init())
.pipe(autoprefixer())
.pipe(concat('style.css'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./public/stylesheets/css'));
});
gulp.task('sass-watch', gulp.task('scss'), () => {
let watcher = gulp.watch('./public/stylesheets/scss/*.scss', ['scss']);
watcher.on('change', function () {
console.log("sass file changed");
});
});
gulp.task('express', () => {
server.run(['./app.js']);
})
gulp.task('lint', () => {
return gulp.src(['**/*.js','!node_modules/**'])
.pipe(eslint({ useEslintrc: true }))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('default', gulp.parallel('sass-watch', 'express'));