Open
Description
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...
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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.