Overview
Vite Plugin Sass DTS is a powerful tool designed for developers who want to ensure type safety when using CSS modules with Sass. This plugin automatically generates TypeScript declaration files, allowing for a smoother integration of styles in type-safe environments. Its unique features simplify the handling of styles in larger projects while maintaining clarity and coherence across different file types.
For developers working in both development and production modes, this plugin offers customizable options that can significantly improve the build process. By automatically managing type files, it reduces the chances of errors and enhances the overall workflow, making it an essential addition to any Vite project utilizing Sass.
Features
Enabled Mode: Lets you create d.ts files for CSS modules in various file extensions (css, sass, scss) at build time, with a focus on the ‘development’ mode by default.
Global Generate: Provides the option to output common style sets defined in additionalData of preprocessorOptions as a global type definition file, streamlining style management.
Global Output File Path: Allows you to specify an absolute path for the output of the global common style, with support for relative paths, giving you flexibility in your project structure.
Type Name Replacement: Offers the ability to change type names to any desired value, defaulting to the class name key, which boosts customization according to developer needs.
Output Directory: Designates an absolute path for the output directory for generated declaration files, while also allowing defaults to source directories, optimizing file organization.