1
0
mirror of https://github.com/kognise/water.css.git synced 2025-02-24 05:43:28 +01:00

Tiny stylistic changes

This commit is contained in:
Kognise 2019-04-07 22:00:52 -04:00
parent dd3d306692
commit bab6e27152

View File

@ -1,52 +1,51 @@
var gulp = require('gulp'),
sass = require('gulp-sass'),
postcss = require('gulp-postcss'),
autoprefixer = require("autoprefixer"),
cssnano = require("cssnano"),
sourcemaps = require("gulp-sourcemaps"),
browserSync = require("browser-sync").create();
const gulp = require('gulp')
const sass = require('gulp-sass')
const postcss = require('gulp-postcss')
const autoprefixer = require('autoprefixer')
const cssnano = require('cssnano')
const sourcemaps = require('gulp-sourcemaps')
const browserSync = require('browser-sync').create()
var paths = {
styles: {
src: "src/**/*.scss",
dest: "dist"
},
html: {
src: "index.html"
}
const paths = {
styles: {
src: 'src/**/*.scss',
dest: 'dist'
},
html: {
src: 'index.html'
}
}
function style() {
return(
gulp.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(sass())
.on("error", sass.logError)
.pipe(postcss([autoprefixer(), cssnano()]))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.styles.dest))
.pipe(browserSync.stream())
);
return (
gulp.src(paths.styles.src)
.pipe(sourcemaps.init())
.pipe(sass())
.on('error', sass.logError)
.pipe(postcss([autoprefixer(), cssnano()]))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.styles.dest))
.pipe(browserSync.stream())
)
}
exports.style = style;
function reload(){
browserSync.reload();
function reload() {
browserSync.reload()
}
function watch() {
style();
style()
browserSync.init({
server: {
baseDir: "./",
},
startPath: "index.html"
})
browserSync.init({
server: {
baseDir: './',
},
startPath: 'index.html'
})
gulp.watch(paths.styles.src, style);
gulp.watch(paths.html.src, reload)
gulp.watch(paths.styles.src, style)
gulp.watch(paths.html.src, reload)
}
exports.watch = watch;
module.exports.style = style
module.exports.watch = watch