Skip to content

Commit 2a61e90

Browse files
committed
Criado gulpfile e arquivo de variaveis
1 parent d72bcd4 commit 2a61e90

File tree

4 files changed

+75
-1
lines changed

4 files changed

+75
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
_site
22
.sass-cache
33
.jekyll-metadata
4+
node_modules

_sass/_variables.scss

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$primary-color: #4285F4;
2+
$second-color: #FBBC05;

gulpfile.babel.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
'use strict';
2+
3+
import gulp from 'gulp';
4+
import path from 'path';
5+
import browserify from 'browserify';
6+
import babelify from 'babelify';
7+
import source from 'vinyl-source-stream';
8+
import watchify from 'watchify';
9+
import serve from 'browser-sync';
10+
import rename from 'gulp-rename';
11+
import sass from 'gulp-sass';
12+
13+
let reload = () => serve.reload();
14+
let root = 'www';
15+
let pathJoin = (pathOut, join) => {
16+
pathOut = pathOut || '';
17+
join = join || '';
18+
return path.join(root, pathOut, join);
19+
};
20+
21+
let paths = {
22+
js: pathJoin('js/', '**/*!(.spec.js).js')
23+
, sass: ['./scss/**/*.scss']
24+
, html: [
25+
path.join(root, 'index.html')
26+
, pathJoin('components/', '**/*.html')
27+
]
28+
}
29+
30+
gulp.task('sass', () => {
31+
gulp.src('./scss/index.scss')
32+
.pipe(sass().on('error', sass.logError))
33+
.pipe(minifyCss({
34+
keepSpecialComments: 0
35+
}))
36+
.pipe(rename('main'))
37+
.pipe(rename({ extname: '.min.css' }))
38+
.pipe(gulp.dest('./www/css/'))
39+
});
40+
41+
gulp.task('watch', () => {
42+
let allPaths = [].concat([paths.js], paths.html, [paths.sass]);
43+
gulp.watch(allPaths, ['sass', reload]);
44+
});
45+
46+
gulp.task('serve', () => {
47+
serve({
48+
port: process.env.PORT || 4000,
49+
open: false,
50+
server: { baseDir: root }
51+
});
52+
});
53+
54+
gulp.task('default', (done) => {
55+
sync('serve','sass','watch', done);
56+
console.log('Serviço iniciado... let\'s player');
57+
});

package.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,19 @@
1515
"bugs": {
1616
"url": "https://github.com/GDG-Salvador/gdg-salvador.github.io/issues"
1717
},
18-
"homepage": "https://github.com/GDG-Salvador/gdg-salvador.github.io#readme"
18+
"homepage": "https://github.com/GDG-Salvador/gdg-salvador.github.io#readme",
19+
"dependencies": {
20+
"babel-preset-es2015": "^6.3.13",
21+
"gulp": "^3.9.0",
22+
"path": "^0.12.7"
23+
},
24+
"devDependencies": {
25+
"babelify": "^7.2.0",
26+
"browser-sync": "^2.11.1",
27+
"gulp-minify-css": "^1.2.3",
28+
"gulp-rename": "^1.2.2",
29+
"gulp-sass": "^2.1.1",
30+
"vinyl-source-stream": "^1.1.0",
31+
"watchify": "^3.7.0"
32+
}
1933
}

0 commit comments

Comments
 (0)