UNPKG

@elora-cloud/elora-cli

Version:
29 lines (26 loc) 963 B
import path from 'node:path'; import chalk from 'chalk'; import consola from 'consola'; import { src, dest } from 'gulp'; import autoprefixer from 'gulp-autoprefixer'; import cleanCSS from 'gulp-clean-css'; import gulpSass from 'gulp-sass'; import dartSass from 'sass'; function EloraBuildSkin(option) { const sass = gulpSass(dartSass); return (src(path.resolve(option.srcDir, option.themeSourceDir)) .pipe(sass.sync({ includePaths: ['node_modules'], })) .pipe(autoprefixer({ cascade: false })) .pipe(cleanCSS({}, (details) => { consola.success(`${chalk.cyan(details.name)}: ${chalk.yellow(details.stats.originalSize / 1000)} KB -> ${chalk.green(details.stats.minifiedSize / 1000)} KB`); })) // .pipe( // rename((path) => { // path.extname = path.extname.replace('css', 'scss'); // }) // ) .pipe(dest(option.distDir))); } export { EloraBuildSkin };