You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current preprocessor configuration allows for customiziation of the underlying preprocessor. For sass and scss the options get merged with vite options for these processors. The Importer array will get merged with an internalImporter from vite.
The internalImporter handles all files which he can resolve. In my case there are also file types (json) which he can resolve, but cant make any sense of it, so failing the build.
The way it's implemented currently, with the internalImporter always first, makes it impossible to register a custom importers to act on the filesystem like node-sass-json-importer
Suggested solution
In order to handle other file types, i think it would be best, to prepend custom importers from user options. This would allow any importer to choose, if he handles the file or not.
Description
The current preprocessor configuration allows for customiziation of the underlying preprocessor. For sass and scss the options get merged with vite options for these processors. The Importer array will get merged with an internalImporter from vite.
The internalImporter handles all files which he can resolve. In my case there are also file types (json) which he can resolve, but cant make any sense of it, so failing the build.
The way it's implemented currently, with the internalImporter always first, makes it impossible to register a custom importers to act on the filesystem like node-sass-json-importer
Suggested solution
In order to handle other file types, i think it would be best, to prepend custom importers from user options. This would allow any importer to choose, if he handles the file or not.
This had to be implemented in (
vite/packages/vite/src/node/plugins/css.ts
Lines 1441 to 1446 in f541239
Alternative
An alternative would be to change the internalImporter to only handle files which he can, dependending on the preprocessor.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: