Skip to content

smoosee/vite-plugin-sass

Repository files navigation

vite-plugin-sass

Vite plugin for resolving sass urls.

Table of Contents

Install

  1. Install the plugin:
yarn add @smoosee/vite-plugin-sass -D
  1. Add the plugin
import { defineConfig } from 'vite';
import VitePluginSass from '@smoosee/vite-plugin-sass';

export default defineConfig({
    plugins: [VitePluginSass()],
});

How it works

  • This plugin is meant mainly to fix a long standing issue with vite 7651/11012.

  • The plugin is enforced pre, and it compiles the original sass code into css (not redundant to the vite compiling process).

  • Using source-maps library inside a postcss plugin to resolve the original paths of where url() methods are called in the .scss files, and updating the source files with the relative address of those assets to the root .scss file.

About

a minimal vite plugin to resolve url paths in compiled sass files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •