Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add moduleId param to options that allow customization of virtualModuleId #18

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

stryaponoff
Copy link
Contributor

My project needs multiple fonts to be generated so I solve it with multiple instances of this plugin with different moduleId.

@atlowChemi
Copy link
Owner

@stryaponoff I missed this PR, do you want to fix conflicts so I can push it forward?

# Conflicts:
#	README.md
#	src/index.ts
const DEFAULT_MODULE_ID = 'vite-svg-2-webfont.css';

function getVirtualModuleId<T extends string>(moduleId: T): `virtual:${T}` {
return `virtual:${moduleId}`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the virtual prefix should also be a const?
WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do it if you want, but I personally don't think it's necessary because it's just a simple conventional value that never implies to be changed and it is not used anywhere else.

@atlowChemi atlowChemi changed the title Add moduleId param to options that allow customization of virtualModuleId Add moduleId param to options that allow customization of virtualModuleId Feb 22, 2024
@atlowChemi atlowChemi merged commit de6eb10 into atlowChemi:main Feb 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants