unocss-transformer-css-url-rebase
v1.0.0
Published
A Unocss transformer that converts relative paths in 'url(...)' to absolute paths based on the project root, allowing Vite to recognize and handle these assets.
Downloads
8
Maintainers
Readme
Install
pnpm i -D unocss-transformer-starter// uno.config.ts
import { defineConfig } from 'unocss'
import transformerCssUrlRebase from 'unocss-transformer-css-url-rebase'
export default defineConfig({
// ...
transformers: [
transformerCssUrlRebase({
root: __dirname,
}),
],
})Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| root | string | undefined | The root directory of the project. Not setting this will not affect the actual generated styles, it only affects the prompt function of the VSCode Unocss extension. |
