question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

imported lib files are not scanned

See original GitHub issue

Describe

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.

Imgur

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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
antfucommented, Mar 16, 2021

That’s a good point @germsb, maybe we can have a different strategy to do that on the build. Thanks for bring this up

0reactions
Brinken90commented, Apr 27, 2022

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found