1.0.3 • Published 1 year ago

@smoosee/vite-plugin-sass v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.