Compare commits

...

3 commits

Author SHA1 Message Date
Marley
075865c364 supernova: add gulp-sourcemaps, rename css 2023-06-17 08:26:07 -07:00
Marley
26945b4501 supernova: add gulp-sourcemaps, rename css 2023-06-17 08:25:16 -07:00
Marley
caf23d1fd2 supernova: fix posthtml-postcss options 2023-06-17 08:23:08 -07:00

View file

@ -2,6 +2,7 @@ const {src, dest, watch, parallel} = require('gulp')
const posthtml = require('gulp-posthtml') const posthtml = require('gulp-posthtml')
const rename = require('gulp-rename') const rename = require('gulp-rename')
const browserSync = require('browser-sync').create() const browserSync = require('browser-sync').create()
const sourcemaps = require('gulp-sourcemaps')
const htmlFiles = [ const htmlFiles = [
'supernova/**/*.html', 'supernova/**/*.html',
@ -40,7 +41,7 @@ function html() {
root: 'supernova', root: 'supernova',
plugins: posthtmlPlugins plugins: posthtmlPlugins
}), }),
require('posthtml-postcss')(postcssPlugins, /^text\/css$/), require('posthtml-postcss')(postcssPlugins, {}, /^text\/css$/),
])) ]))
.pipe(rename(path => { .pipe(rename(path => {
path.basename = 'index' path.basename = 'index'
@ -61,7 +62,12 @@ const cssFiles = [
function css() { function css() {
const stream = src(cssFiles) const stream = src(cssFiles)
.pipe(sourcemaps.init())
.pipe(require('gulp-postcss')(postcssPlugins)) .pipe(require('gulp-postcss')(postcssPlugins))
.pipe(rename(path => {
path.basename = 'style'
}))
.pipe(sourcemaps.write())
.pipe(dest('supernova')) .pipe(dest('supernova'))
if (browserSync.active) { if (browserSync.active) {