-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.local.js
69 lines (53 loc) · 1.61 KB
/
gulpfile.local.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict'
const argv = require('yargs').argv;
const pkg = require('./package.json');
const gulp = require('gulp');
const data = require('gulp-data');
const connect = require('gulp-connect');
const rename = require('gulp-rename');
const template = require('gulp-template');
let config = {
version: pkg.version,
build: 'local',
env: 'dev',
sass: {
outputStyle: 'expanded' // nested, compact, expanded, compressed
},
css: {
compress: false
},
js: {
compress: false
},
html: {
compress: false
},
bower: {},
dest: './dist',
// 測試
test: {
browsers: ['chrome'],
filter: null,
dest: "./temp"
}
}
require('./gulpfile.base.js')(gulp, config);
gulp.task('localhost', ['bower', 'plugins', 'sass', 'js', 'html', 'images', 'resources'], () => {
gulp.watch('./src/global/*.js', ['js']);
gulp.watch('./src/scripts/**/*.js', ['js']);
gulp.watch('./src/utils/*.js', ['js']);
gulp.watch('./src/layout/*.html', ['html']);
gulp.watch('./src/page/*.html', ['html']);
gulp.watch('./src/resources/**/*.html', ['html']);
gulp.watch('./src/styles/**/*.scss', ['sass']);
gulp.watch('./src/themes/**/*.scss', ['sass']);
gulp.watch('./src/images/**/*', ['images']);
connect.server({
root: 'dist'
});
});
gulp.task('default', ['clean'], () => {
setTimeout(function () {
gulp.start(['localhost']);
}, 1000);
});