root gulpfile that imports specific gulp files - for vercel
This commit is contained in:
parent
aa41f780b4
commit
5fc1c9ee30
3 changed files with 22 additions and 6 deletions
6
gulpfile.js
Normal file
6
gulpfile.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
const {parallel} = require('gulp')
|
||||
|
||||
const sues_virtual_life = require('./sues_virtual_life/gulpfile')
|
||||
exports.sues_virtual_life = sues_virtual_life.watch
|
||||
|
||||
exports.build = parallel(sues_virtual_life.build)
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"scripts": {
|
||||
"dev": "browser-sync start --config bs-config.js"
|
||||
"build": "gulp build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browser-sync": "^2.29.3",
|
||||
|
|
|
@ -3,10 +3,13 @@ const posthtml = require('gulp-posthtml')
|
|||
const rename = require('gulp-rename')
|
||||
const browserSync = require('browser-sync').create()
|
||||
|
||||
const htmlFiles = ['./**/*.html', '!./**/index.html']
|
||||
const htmlFiles = [
|
||||
'sues_virtual_life/**/*.html',
|
||||
'!sues_virtual_life/**/index.html',
|
||||
]
|
||||
|
||||
function html() {
|
||||
return src(htmlFiles)
|
||||
const stream = src(htmlFiles)
|
||||
.pipe(posthtml([
|
||||
require('posthtml-urls')({
|
||||
eachURL: (url) => {
|
||||
|
@ -21,13 +24,20 @@ function html() {
|
|||
.pipe(rename(path => {
|
||||
path.basename = 'index'
|
||||
}))
|
||||
.pipe(dest('.'))
|
||||
.pipe(browserSync.stream())
|
||||
.pipe(dest('sues_virtual_life'))
|
||||
|
||||
if (browserSync.active) {
|
||||
stream.pipe(browserSync.stream())
|
||||
}
|
||||
|
||||
exports.default = function () {
|
||||
return stream
|
||||
}
|
||||
|
||||
exports.watch = function () {
|
||||
browserSync.init(require('../bs-config'))
|
||||
|
||||
watch(htmlFiles, {ignoreInitial: false}, html)
|
||||
watch('sues_virtual_life.css').on('change', browserSync.reload)
|
||||
}
|
||||
|
||||
exports.build = html
|
||||
|
|
Loading…
Reference in a new issue