@obuild/plugin-sass
v0.0.1
Published
PostCSS plugin for obuild
Readme
📦 @obuild/plugin-sass 😯
Sass plugin for obuild.
This plugin integrates the Sass processor into the obuild build system, allowing you to transform CSS files using Sass plugins.
Usage
Import the plugin in your build configuration and add it to the plugins array. You can also configure it with options.
import { defineBuildConfig } from "obuild/config";
import { sass } from "@obuild/plugin-sass";
export default defineBuildConfig({
entries: [
{
type: "transform",
input: "./src/runtime/",
outDir: "./dist/runtime/",
plugins: [
sass({
// Configuration options
}),
],
},
],
});Options
The following interface describes the options you can pass to the plugin:
import type { StringOptions } from "sass";
import type { Config, Extensions } from "./config.ts";
import type { AssetFile, InputFile, PluginContext } from "obuild";
export interface SassPluginOptions {
/** File extensions that this plugin should process. */
extensions?: Extensions;
/**
* Options for the Sass compiler. These options are passed to the
* `sass.compileString` function. See
* https://sass-lang.com/documentation/js-api/interfaces/stringoptions/ for
* more details.
*/
options?: Omit<StringOptions<"sync">, "url">;
/**
* Configuration hook that allows you to modify the configuration for a
* specific file.
*
* @param file - The input file.
* @param config - The current configuration for the plugin.
* @param context - The plugin context.
* @returns Modified configuration or undefined if the file should not be
* processed.
*/
fileConfig?: (
file: InputFile | AssetFile,
config: Config,
context: PluginContext,
) => Config | undefined;
}License
💛 Released under the MIT license.
🤖 auto updated with automd
