Skip to content
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

Attempt to improve support for using the PDF.js builds with Vite #18395

Closed

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jul 5, 2024

Similar to Webpack there's apparently other bundlers that will not leave import-calls alone unless magic comments are used. Hence we extend the builder to also append /* @vite-ignore */ comments to import-calls, in order to attempt to improve support for using the PDF.js builds together with Vite.

This patch also renames __non_webpack_import__ to __raw_import__ since the functionality is no longer bundle-specific.

Fixes #17245 (comment)


Please note: This will further increase the maintenance/support burden of the general PDF.js library, for a feature that's completely unused within the project itself.
Hence, if you'd like to see this patch landed, please contact me privately to discuss sponsoring this work (email address can be found in my GitHub profile).

Similar to Webpack there's apparently other bundlers that will not leave `import`-calls alone unless magic comments are used.
Hence we extend the builder to also append `/* @vite-ignore */` comments to `import`-calls, in order to attempt to improve support for using the PDF.js builds together with Vite.

This patch also renames `__non_webpack_import__` to `__raw_import__` since the functionality is no longer bundle-specific.
@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Jul 23, 2024

Closing for now, since no one seem to actually need or want this.

@GitMurf

This comment was marked as resolved.

@Foxandxss
Copy link

Can we revisit this? Many libraries depend on this one and for vite users, this is needed.

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Sep 19, 2024

Can we revisit this? Many libraries depend on this one and for vite users, this is needed.

@Foxandxss Please read all of #18395 (comment), from which I'm quoting:

Please note: This will further increase the maintenance/support burden of the general PDF.js library, for a feature that's completely unused within the project itself.
Hence, if you'd like to see this patch landed, please contact me privately to discuss sponsoring this work (email address can be found in my GitHub profile).

@t0m-4

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants