gulp-sass 安装 gulp 编译 scss 文件

下载依赖
npm install gulp-sass sass
gulpfile.js
const { src, dest, series, watch } = require('gulp')
const scss = require('gulp-sass')(require('sass'))

const devPath = './src/'
const outputPath = './pages/'

function handleScss() {
  return src(devPath + 'scss/**/*.scss')
    .pipe(scss())
    .pipe(dest(outputPath + 'test'))
}

function watchFun() {
  return watch(devPath + '**/*', series(handleScss))
}

exports.default = watchFun
posted @ 2022-03-26 11:48  柯宝宝智商感人  阅读(75)  评论(0编辑  收藏  举报