unplugin / unplugin-icons

šŸ¤¹ Access thousands of icons as components on-demand universally.

Home Page:https://www.npmjs.com/package/unplugin-icons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Virtual Svelte module ids should start with `\0`

IanVS opened this issue Ā· comments

Describe the bug

This tool creates virtual modules for svelte, which can cause problems for other plugins which attempt to load those files, not realizing they are virtual. The plugin documentation for rollup specifies:

If your plugin uses 'virtual modules' (e.g. for helper functions), prefix the module ID with \0. This prevents other plugins from trying to process it.

So, should virtual modules created when unplugin-icons is configured with compiler: "svelte" be prefixed? Or is there another way that other plugins should detect these are virtual modules, ideally without hitting the filesystem?

See storybookjs/storybook#20562 for the issue in Storybook.

Reproduction

https://github.com/enyo/storybook-test/tree/main/my-app

System Info

System:
    OS: macOS 13.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 16.05 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 3.4.1 - ~/.yarn/bin/yarn
    npm: 8.12.1 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Brave Browser: 111.1.49.120
    Firefox: 110.0.1
    Safari: 16.2

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

I feel that it's best for integrations to be able to process virtual modules. As in this case, our virtual module is mean to be processed by other plugins (we serve raw components).