imported lib files are not scanned
See original GitHub issueDescribe
In monorepo, I have two project, one component library, one app. Both use vite, windicss and vue.
The library export tree-shakable components
export {default as TestComp1} from './components/Test1.vue';
export {default as TestComp2} from './components/Test2.vue';
TestComp1 looks like this:
<template>
<div class="bg-pink-500 text-white">hello</div>
</template>
<script setup lang="ts"></script>
Then I import library component in the app
<template>
<div class="bg-purple-400">
<TestComp1/>
</div>
</template>
<script setup lang="ts">
import {TestComp1} from 'windicss-lib';
</script>
bg-pink-500 and text-white classes are not generated.

I have checked the plugin options but I did not find a solution. If i Include the node_modules for scan, I’m afraid of ending up with too much CSS, because it will scan all the components even the ones I don’t use.
Edit:
indeed, if I add my lib to the scan.dir option, it is scanned as a whole, so at the end, I will have to purge the final bundle.
Versions
- vite-plugin-windicss: 0.8.2
- vite: 2.05
- framework(vue/react/svelte/etc): vue 3.0.7
Additonal Context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How can I import a lib file? scanner occur ...
Refers to a non-existent directory on the filesystem. I have 아현.csv in the lib folder. Put it in src/main/assets/ of your module.
Read more >Imported Scans do not show in Photos App - Apple Community
When the scan is completed, the Photos App does not open and the scan is not visible unless I go through finder in....
Read more >"File successfully imported" when files are not processing in ...
Right-click the Scan Administrator icon and select Run as administrator. Click Services tab. Click Start all services.
Read more >scanning library is failing to import 1 file [#17862]
If you're unable to resolve with the above instructions can you please open a Support Ticket and share the file that fails in...
Read more >Importing documents from scanning applications - FileHold
This option cannot be used in conjunction with the "Delete input files after they have been successfully added to the FileHold Library" check...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

That’s a good point @germsb, maybe we can have a different strategy to do that on the build. Thanks for bring this up
@antfu any updates on this? I’m running into the same issue. If not, you wrote that a function for generating the safelist in this issue #132 , do you know if it would be possible to access the component list inside of a plugin?