Skip to content

Commit 36ba54c

Browse files
committed
[LES-6.2/compl] intro-to-gulp
Adding first "tasks". Working with "npm, require(), pipe, exports". Worth noting: - doubts about "gulp" relevance today. core: B-4 / WL-AL
1 parent 868bfa3 commit 36ba54c

File tree

13 files changed

+2412
-1
lines changed

13 files changed

+2412
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Intro to Gulp</title><link rel="stylesheet" href="./css/style.css"></head><body><p>Hello Gulp!</p><script src="js/main.js"></script></body></html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
body {
2+
color: #fff;
3+
}
4+
5+
body {
6+
margin: 0;
7+
background-color: red;
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { src, dest, series, watch } = require('gulp');
2+
const concat = require('gulp-concat');
3+
const htmlmin = require('gulp-htmlmin');
4+
5+
const styles = () => {
6+
return src('./src/css/**/*.css').pipe(concat('main.css')).pipe(dest('dist'));
7+
};
8+
9+
const htmlMinify = () => {
10+
return src('src/**/*.html')
11+
.pipe(
12+
htmlmin({
13+
collapseWhitespace: true,
14+
})
15+
)
16+
.pipe(dest('dist'));
17+
};
18+
19+
exports.styles = styles;
20+
exports.htmlMinify = htmlMinify;
21+
22+
exports.default = series(styles, htmlMinify);

0 commit comments

Comments
 (0)