Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /*! | 1 /*! |
2 * This file is part of universal-design-language | 2 * This file is part of universal-design-language |
3 * Copyright (C) 2016 Eyeo GmbH | 3 * Copyright (C) 2016 Eyeo GmbH |
4 * | 4 * |
5 * universal-design-language is free software: you can redistribute it and/or | 5 * universal-design-language is free software: you can redistribute it and/or |
6 * modify it under the terms of the GNU General Public License as published by | 6 * modify it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation, either version 3 of the License, or | 7 * the Free Software Foundation, either version 3 of the License, or |
8 * (at your option) any later version. | 8 * (at your option) any later version. |
9 * | 9 * |
10 * universal-design-language is distributed in the hope that it will be useful, | 10 * universal-design-language is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * GNU General Public License for more details. | 13 * GNU General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU General Public License | 15 * You should have received a copy of the GNU General Public License |
16 * along with web.starter-kit. If not, see <http://www.gnu.org/licenses/>. | 16 * along with web.starter-kit. If not, see <http://www.gnu.org/licenses/>. |
17 */ | 17 */ |
18 | 18 |
19 const gulp = require("gulp"); | 19 const gulp = require("gulp"); |
20 const sass = require("gulp-sass"); | 20 const sass = require("gulp-sass"); |
21 const stylelint = require("gulp-stylelint"); | |
22 const htmlhint = require("gulp-htmlhint"); | |
23 const connect = require("gulp-connect"); | 21 const connect = require("gulp-connect"); |
24 const sourcemaps = require("gulp-sourcemaps"); | |
25 | 22 |
26 gulp.task("connect", function() | 23 gulp.task("connect", function() |
27 { | 24 { |
28 connect.server({ | 25 connect.server({ |
29 root: ".", | 26 root: ".", |
juliandoucette
2016/11/25 16:28:40
Note:
I changed the root from "." to "test" (prev
| |
30 livereload: true | 27 livereload: true |
saroyanm
2016/11/21 18:44:35
Suggestion: I'd vote for removing this feature, I
juliandoucette
2016/11/22 00:54:02
Acknowledged.
I will remove it.
juliandoucette
2016/11/25 16:28:40
Done.
| |
31 }); | 28 }); |
32 }); | |
33 | |
34 gulp.task("lint:css", function() | |
35 { | |
36 return gulp.src("scss/*.scss") | |
37 .pipe(stylelint({ | |
38 reporters: [ | |
39 {formatter: "string", console: true} | |
40 ] | |
41 })); | |
42 }); | |
43 | |
44 gulp.task("lint:html", function() | |
45 { | |
46 return gulp.src("html/*.html") | |
47 .pipe(htmlhint()); | |
48 }); | 29 }); |
49 | 30 |
50 gulp.task("html", function() | 31 gulp.task("html", function() |
saroyanm
2016/11/21 18:44:35
What is this task used for ?
Do we need it ?
juliandoucette
2016/11/22 00:54:02
Acknowledged.
It's used to reload the page when H
juliandoucette
2016/11/25 16:28:40
Done.
| |
51 { | 32 { |
52 gulp.src("html/*.html") | 33 gulp.src("html/*.html") |
53 .pipe(connect.reload()); | 34 .pipe(connect.reload()); |
54 }); | 35 }); |
55 | 36 |
56 gulp.task("scss", function () | 37 gulp.task("scss", function () |
57 { | 38 { |
58 return gulp.src("./scss/main.scss") | 39 return gulp.src("./scss/main.scss") |
59 .pipe(sourcemaps.init()) | |
60 .pipe(sass().on("error", sass.logError)) | 40 .pipe(sass().on("error", sass.logError)) |
61 .pipe(sourcemaps.write("./")) | |
62 .pipe(gulp.dest("./css/")) | 41 .pipe(gulp.dest("./css/")) |
juliandoucette
2016/11/25 16:28:41
Note:
I changed this output directory so that we
| |
63 .pipe(connect.reload()); | 42 .pipe(connect.reload()); |
64 }); | 43 }); |
65 | 44 |
66 gulp.task("watch", function () | 45 gulp.task("watch", function () |
67 { | 46 { |
68 gulp.watch("html/*.html", ["lint:html", "html"]); | 47 gulp.watch("html/*.html", ["html"]); |
69 gulp.watch("scss/*.scss", ["lint:css", "scss"]); | 48 gulp.watch("scss/*.scss", ["scss"]); |
70 }); | 49 }); |
71 | 50 |
72 gulp.task("lint", ["lint:html", "lint:css"]); | 51 gulp.task("default", ["scss", "connect", "watch"]); |
73 | |
74 gulp.task("default", ["lint", "scss", "connect", "watch"]); | |
LEFT | RIGHT |