add and configure gulp
This commit is contained in:
parent
58ecaf99b2
commit
1d135a1b7d
7 changed files with 5061 additions and 8 deletions
36
gulpfile.mjs
Normal file
36
gulpfile.mjs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import gulp from "gulp"
|
||||
const { watch, parallel, src, dest } = gulp
|
||||
import cssnano from "gulp-cssnano"
|
||||
import autoprefixer from "gulp-autoprefixer"
|
||||
import cssimport from "gulp-cssimport"
|
||||
import babel from "gulp-babel"
|
||||
|
||||
function cssProcess() {
|
||||
return src("assets/css/style.css")
|
||||
.pipe(cssimport())
|
||||
.pipe(
|
||||
autoprefixer({
|
||||
cascade: false,
|
||||
})
|
||||
)
|
||||
.pipe(cssnano())
|
||||
.pipe(dest("assets/dist"))
|
||||
}
|
||||
|
||||
function jsProcess() {
|
||||
return src("assets/js/script.js")
|
||||
.pipe(
|
||||
babel({
|
||||
presets: ["@babel/env"],
|
||||
})
|
||||
)
|
||||
.pipe(dest("assets/dist"))
|
||||
}
|
||||
|
||||
function dev() {
|
||||
watch("assets/css/src/*.css", cssProcess)
|
||||
}
|
||||
|
||||
const build = parallel(cssProcess, jsProcess)
|
||||
|
||||
export { dev, build }
|
||||
Loading…
Add table
Add a link
Reference in a new issue