-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstyles.js
More file actions
36 lines (34 loc) · 1.01 KB
/
styles.js
File metadata and controls
36 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gulp from 'gulp'
import { paths } from '../gulpfile'
import sass from 'gulp-sass'
import moduleImporter from 'sass-module-importer'
import postcss from 'gulp-postcss'
import postcssPresetEnv from 'postcss-preset-env'
import notify from 'gulp-notify'
export function styles() {
return gulp.src(paths.styles, { allowEmpty: true, sourcemaps: true })
.pipe(
sass({
// compile to expanded css because
// this is a browser extension
outputStyle: 'expanded',
// import scss from node_modules
importer: moduleImporter(),
includePaths: 'node_modules/',
})
)
.on('error', notify.onError({
title: 'Error compiling sass!',
}))
.pipe(
postcss([
// autoprefixer for the browserslist in package.json
// and other futuristic css features
postcssPresetEnv({ stage: -1 }),
])
)
.on('error', notify.onError({
title: 'Error compiling postcss!',
}))
.pipe(gulp.dest('build', { sourcemaps: '.' }))
}