Replies: 6 comments 6 replies
-
I get a similar error trying to write an external source plugin in typescript, but here I suspect it might not be supported:
|
Beta Was this translation helpful? Give feedback.
-
Hey @lschierer 👋
So as part of the v0.30.0 release, we deprecated that plugin (along with the JSON version) since we have now added support for CSS / JSON import attributes to Greenwood out of the box. The good news though is that you can substitute that plugin with @greenwood/plugin-import-raw which can do the same thing for CSS, JSON, SVGs, etc. So after installing that plugin instead, now you can just write this to get the same behavior of getting the CSS as a string import css from '../path/to/styles.css?type=raw'; (I made a mistake in thinking that marking those packages to
Hmm, yeah, that should be working as you expect it, I just looked at our test case for that and it seems to confirm this is the expected behavior. (greenwood.config.js does not need to set the Looking at the code though, I think I may see an issue where-in that default value is being wiped out when additional configuration options are provided, like if passing Can you try either of these variations and let me know if either of these work for you? // this could work since you have our own _tsconfig.json_
export default {
prerender: false,
plugins: [
greenwoodPluginTypeScript(),
// ...
],
}; // this should make both options work together, worse case scenario
export default {
prerender: false,
plugins: [
greenwoodPluginTypeScript({
extendConfig: true,
servePage: 'dynamic'
}),
// ...
],
}; My guess is we just need to better handle mixing / matching various default options which should be an easy enough to address. Good catch on your end if so! Let me know what you find and we can get a patch out for that as needed. |
Beta Was this translation helpful? Give feedback.
-
with
(I removed the source plugin I was trying since I first posted) I get
|
Beta Was this translation helpful? Give feedback.
-
with
I get much the same:
|
Beta Was this translation helpful? Give feedback.
-
okay, this configuration worked (note, i had to adjust the loader command from what you suggested): greenwood.config.js:
tsconfig.json:
package.json:
|
Beta Was this translation helpful? Give feedback.
-
thanks for the help!! |
Beta Was this translation helpful? Give feedback.
-
Right now I have greenwood cli 0.30.0 with plugins at the same version except the @greenwood/plugin-import-css which for which 0.29.4 appears to still be the latest release. I've configured my greenwood.js with
and my tsconfig.json with
however, I am getting a message
Unsupported format detected for page => index.ts
for a file "src/pages/index.ts" attempting to follow the example at https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-renderer-lit with the only change being to use the .ts file extension instead of the .js file extension. I'm not sure if this is a limitation of greenwood at the current time, or if it is something I'm doing wrong. I suspect its something I'm doing wrong, as the typescript plugin has the section on the bottom about disabling SSR pages that I haven't touched (my greenwood.js file does not have the servePage option at at all).any advice on getting this working would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions