@zilero/gulp-scss-compiler
v1.0.1
Published
A powerful Gulp plugin for SCSS optimization with embedded Sass compiler and advanced configuration options for optimal SCSS processing
Maintainers
Readme
📦 Powerful Gulp plugin for SCSS compilation with embedded Sass compiler.
Installation • Options • Example
✨ Features
- 📦 SCSS compilation using embedded Sass
- 🚀 High-performance processing
- 🗺️ Source maps support
- 🔧 Highly configurable
- 📝 TypeScript support
- 💡 Progress logging
- 🛠️ Pre and post processing hooks
- 🔄 Stream-based processing
🚀 Installation
npm install @zilero/gulp-scss-squeezer --save-dev
# or
yarn add @zilero/gulp-scss-squeezer --dev
# or
pnpm add @zilero/gulp-scss-squeezer --save-dev⚙️ Options
scssOptions
- Type:
Options<'sync'>(sass-embedded options) - Required:
false - Default:
{} - All options from sass-embedded are supported
pluginOptions
- Type:
object - Required:
false
pluginOptions.onBeforeCompile
- Type:
(content: string) => Promise<string> - Required:
false - Transform SCSS content before compilation
pluginOptions.onAfterCompile
- Type:
(content: string) => Promise<string> - Required:
false - Transform CSS content after compilation
📝 Example
gulp.task('compile-scss', () => {
return gulp.src('src/scss/**/*.scss')
.pipe(GulpScssSqueezer({
scssOptions: {
style: 'compressed',
},
pluginOptions: {
onBeforeCompile: async (content) => {
// Custom pre-processing
return content;
},
onAfterCompile: async (content) => {
// Custom post-processing
return content;
}
}
}))
.pipe(gulp.dest('dist/css'));
});
// With source maps
gulp.task('compile-scss-with-maps', () => {
return gulp.src('src/scss/**/*.scss')
.pipe(GulpScssSqueezer({
scssOptions: {
style: 'expanded',
sourceMap: true,
sourceMapIncludeSources: true
}
}))
.pipe(gulp.dest('dist/css'));
});🤝 Contributing
If you would like to contribute to the project, please create a pull request or leave feedback. We are always open to new ideas and improvements!
🐛 Issues
Found a bug? Want to request a feature? Please create an issue.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Zilero
