Description
Hi their!
Hope you are doing well! At start, thanks for your work!
It will be nice to be able to specify the resolver options supported by the lightningcss compiler but that seems to be not passed and supported on the vite side...
|
export type LightningCSSOptions = { |
Suggested solution
Add the resolver option in the LightningCSSOptions type as well as passing it to the lightningcss compiler.
Alternative
No response
Additional context
Example of use:
// vite.config.ts
import { browserslistToTargets } from "lightningcss";
import fs from 'fs';
import path from 'path';
export default {
css: {
transformer: "lightningcss",
lightningcss: {
resolver: {
read(filePath) {
console.log(filePath);
return fs.readFileSync(filePath, "utf8");
},
resolve(specifier, from) {
return path.resolve(path.dirname(from), specifier);
},
},
targets: browserslistToTargets(browserslist(">= 0.25%")),
},
},
build: {
cssMinify: "lightningcss",
},
};
Validations
Description
Hi their!
Hope you are doing well! At start, thanks for your work!
It will be nice to be able to specify the
resolveroptions supported by the lightningcss compiler but that seems to be not passed and supported on the vite side...vite/packages/vite/src/types/lightningcss.d.ts
Line 13 in 6a7dde5
Suggested solution
Add the
resolveroption in theLightningCSSOptionstype as well as passing it to the lightningcss compiler.Alternative
No response
Additional context
Example of use:
Validations