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

Allow customizing the fontFace URL for production environment through cssFontsUrl. #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kakigakki
Copy link

Allow customizing the Css fontFace URL for production environment through options.cssFontsUrl.

@kakigakki kakigakki changed the title Allow customizing the CSS URL for production environment through cssFontsUrl. Allow customizing the fontFace URL for production environment through cssFontsUrl. Apr 17, 2023
Comment on lines +89 to +90
this.emitFile({ type: 'asset', fileName: `assets/${processedOptions.fontName}-${guid()}.${type}`, source: generatedFonts?.[type] }),
).replace('assets', cssFontsUrl)}`,
Copy link
Owner

Choose a reason for hiding this comment

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

would this work also?

Suggested change
this.emitFile({ type: 'asset', fileName: `assets/${processedOptions.fontName}-${guid()}.${type}`, source: generatedFonts?.[type] }),
).replace('assets', cssFontsUrl)}`,
this.emitFile({ type: 'asset', fileName: `${cssFontsUrl}/${processedOptions.fontName}-${guid()}.${type}`, source: generatedFonts?.[type] }),
)`,

Copy link
Author

Choose a reason for hiding this comment

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

I tried, but unfortunately, it appears to be unsuccessful.

Copy link
Owner

Choose a reason for hiding this comment

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

Doesn't this mean we emit the file to 1 location (assets), and then import it from another location (cssFontsUrl)?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, indeed. It may be because I specified rollupOptions.build.out, so the emitted files will be placed in the assets folder under the out directory.

Copy link
Owner

Choose a reason for hiding this comment

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

Would this work when not setting that setting as you have?
Would you be willing to fix this if not?

@atlowChemi atlowChemi linked an issue Jul 11, 2023 that may be closed by this pull request
@atlowChemi atlowChemi mentioned this pull request Jul 11, 2023
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.

dest not being used?
2 participants