Open i-am-the-slime opened 6 months ago
Valid request. We would need to add specifiers
/ ExportSpecifier
here.
It's a different case from other ExportedNamedDeclarations.
Should be fairly straightforward if you want to open a PR.
Would it be (easily) possible to also support StoryDefault
exported in export
block like:
var storyDefault = {
title: "Custom Title"
};
export {
hello_world ,
storyDefault as default,
}
If this is not yet covered by #556, would anybody have some pointers on what needs to be done to support it?
@woeps have you tried my branch? There's a test you can probably modify and see if it works already
@i-am-the-slime I tried your branch locally and it seems StoryDefault
in export block is not supported yet.
I haven't tinkered with any tests: Do you mean the tests in packages/ladle/tests/parse/get-storyname-and-meta.test.ts?
@woeps I mean this one on my fork/branch:
Is your feature request related to a problem? Please describe. I'm using ladle with PureScript and it almost works. It's just that the compiler output looks like this:
This leads to the following error:
If I manually change this to say
export var someStory =...
and remove theexport
block it works fine.Interestingly, it keeps working from there on out (so even when the file gets overwritten)
Describe the solution you'd like I'd love for this to simply work without me having to change the output of the compiler.
Describe alternatives you've considered If there was a way to hook into the reading of files, I could probably fix this with some regex or something more bespoke that traverses the AST, so that could be an alternative. If that's something I could do with vite out of the box I'd be happy about any pointers.