Skip to content

Commit

Permalink
Setup gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
katharinabrx committed Jun 29, 2019
1 parent 86f131d commit 5435f37
Show file tree
Hide file tree
Showing 6 changed files with 6,186 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [ "@babel/preset-env" ]
}
3 changes: 3 additions & 0 deletions dist/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// General
import gulp from 'gulp';
import del from 'del';
import rename from 'gulp-rename';
import sourcemaps from 'gulp-sourcemaps'

// CSS
import sass from 'gulp-sass';
import autoprefixer from 'gulp-autoprefixer';

// Paths
const paths = {
src: './src/**/*',
dest: './dist/**/*',

styles: {
src: './src/scss/*.scss',
dest: './dist/'
}
};

export const clean = () => del(paths.dest);

export function styles() {
console.log('styles()');
return gulp.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(autoprefixer())
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(sourcemaps.write())
.pipe(rename('style.min.css'))
.pipe(gulp.dest(paths.styles.dest));
}

function watchFiles() {
gulp.watch(paths.styles.src, styles);
}

const build = gulp.series(clean, styles);

export { watchFiles as watch };
export default build;
Loading

0 comments on commit 5435f37

Please sign in to comment.