-
Notifications
You must be signed in to change notification settings - Fork 9
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
Option to choose list of files to be copied #12
Comments
+1 here, great idea! We started using this neat plugin recently. Because our pyodide build has some additional files included in the npm package, we need to patch the lib/patterns.ts source file with additional files. This improvement to the plugin would allow to avoid the patching altogether. |
I would like to propose an alternative to specifying the file list in constructor. Please consider the following: The list of files that constitute each pyodide build is already listed in the pyodide's package.json file. The pyodide-webpack-plugin already locates and parses the pyodide's @mneil , what is your opinion on this? Are there any risks or alternate usage scenarios for which this automatic file list retrieval would not work? |
@ondrej-stanek-ozobot I do like that idea. This was not the case when the plugin was originally developed. But we could keep the internal list for older versions. Going forward we can rely on the files in the package.json. The one issue I see with that is the files list contains extra data like types definitions and html. Maybe we could do a combination approach? Copy over the list of files in the "files" property of package.json, exclude html and d.ts files, but also allow an override as Gyeongjae mentioned as an override. @ryanking13 what do you think about these suggestions? |
Is copying the html / d.ts files harmful or simply unnecessary? |
It is unnecessary and these files would go unused. |
Presumably there are other unnecessary files in the |
Yes, pyodide.js (or pyodide.mjs) are getting put into the main bundle. The plugin does not currently copy either of those over. |
But if we switch to using the |
Yes, then they would both get copied. These files are copied into the package the user intends to distribute or put into production. There would be a size increase to that output with no benefit to the user. |
But these extra files don't get sent to the client browser? So it's not desirable but also not a huge problem? |
No, they would not get sent to the browser. |
Great! I like the combination approach. |
Addresses part of #12 by guessing which files are needed to go into the bundle based on pyodide package.json files list. Excludes some files like d.ts and .html files. Ensure certain files like package.json are always copied.
First of all, thanks for maintaining this project Michael, I really appreciate it.
As mentioned in pyodide/pyodide-webpack-example#7, it would be nice to test this plugin in Pyodide repository and make sure the upstream changes don't break this plugin. For that, I think we need some way to override the list of files to be copied, as upstream changes may add/remove files to be copied.
Maybe something like:
The text was updated successfully, but these errors were encountered: