Skip to content

plugin: don't panic on missing files#313

Open
wmertens wants to merge 1 commit into
qmhc:mainfrom
wmertens:patch-1
Open

plugin: don't panic on missing files#313
wmertens wants to merge 1 commit into
qmhc:mainfrom
wmertens:patch-1

Conversation

@wmertens
Copy link
Copy Markdown

When using the build API from Vite instead of the CLI, intermediate files are not written it seems. The resulting .d.ts file is correct.

When using the build API from Vite, intermediate files are not written it seems.
@qmhc
Copy link
Copy Markdown
Owner

qmhc commented Mar 19, 2024

Would you share your case about using the build API form Vite?

@wmertens
Copy link
Copy Markdown
Author

@qmhc I'm overhauling the Qwik build scripts and they do a bunch of stuff, so it's better to build via the API

@qmhc
Copy link
Copy Markdown
Owner

qmhc commented Mar 19, 2024

Thanks for your sharing. Is the unlink method thorwing error when you using js API?

@wmertens
Copy link
Copy Markdown
Author

Yes because the files aren't written somehow

@qmhc
Copy link
Copy Markdown
Owner

qmhc commented Mar 20, 2024

I tested locally, it's seems a issue of Vite.

If there a vite config file in root directory and you use API to run Vite, two processes will be created in the same time (plugin is created twice), which will take a error (one process removed some files and the other process cannot file them).

I remove the config file then get it working.

Or don't specify plugins option when you call the build method.

@wmertens
Copy link
Copy Markdown
Author

@qmhc wow good catch! Did you open an issue yet?

@qmhc
Copy link
Copy Markdown
Owner

qmhc commented Mar 20, 2024

Well, I searched the Vite documentation and could not find any description about the plugin name is identifier.

So duplicate plugin names may work. It requires users to avoid creating duplicate plugins.

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