-
Notifications
You must be signed in to change notification settings - Fork 10
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
frontmatter imports not working for any format supported by a resource plugin #1319
Comments
yeah, this seems like probably just an oversight and at a quick glance, probably not specific to TS, just anything not a .js or .css file, but agreed, Greenwood should certainly make sure any resource type supported by a resource plugin also carries support for it in frontmatter imports |
I'm looking at the TypeScript source plugin ATM, and I think a generic solution to this would entail the core application, as a new source plugin is registered, adding its "this.extensions" property to some more central global array of acceptable extensions that it filters the files in the front matter imports by. This is me hypothesizing from what I'm seeing in the code so far at least. |
Yup, pretty much. Taking a quick look now, frontmatter imports are processed starting here in the I think it might also need to be handled in the (also, just a minor technical point, but the TypeScript plugin is technically a resource plugin) |
Got a PR for this up now, and also found a couple other small bugs / tweaks that will benefit Greenwood overall, be it regular resources or a frontmatter imports. Thanks again for the report, will get this queued up for an upcoming alpha release in the v0.31.0 line. 👍 |
This does not appear to be fixed with the 0.31.0-alpha.0 tag
|
Yeah, the PR for this one hasn't been merged yet, alpha.0 was just to validate the first round of PNPM and import map changes, so will get this out for alpha.1 once I've had a chance to digest any compatibility issues with those changes across some of my projects, and to fully complete the work around #1313 / #684 . I'm drafting the alpha.0 release notes as we speak. |
Type of Change
Feature
Summary
the imports field in the frontmatter filters out any files that are not .js and not .css, please support any format supported by any Adapter plugin.
Details
I noticed this trying to import a typescript component in a project that has the typescript plugin enabled. the component works fine if included via layout, and also works fine if included by another component. If however, I attempt to use the imports field, then the corresponding script tag is not generated and the component does not hydrate, it gets processed as an unknown tag.
The text was updated successfully, but these errors were encountered: