Skip to content

Conversation

@bagedevimo
Copy link
Contributor

Some javascript bundles (like vite) emit warnings when they encounter
module.export in an ESM module. This just hides that assignment a little
so that that warning doesn't appear.

Fixes #337

@bogdan
Copy link
Collaborator

bogdan commented Dec 20, 2025

Please add a test for generated JS doesn't contain module.export.

Example: https://github.com/railsware/js-routes/blob/main/spec/js_routes/options_spec.rb#L519

Some javascript bundles (like vite) emit warnings when they encounter
module.export in an ESM module. This just hides that assignment a little
so that that warning doesn't appear.

The spec is a little odd, as I wanted to avoid rewriting the comment in
the routes file to avoid saying module.exports, so it strips out
single-line javascript comments.
@bagedevimo bagedevimo force-pushed the obfuscate-module-exports branch from 32ffffe to f41e0be Compare December 20, 2025 23:52
@bogdan bogdan merged commit 94aef98 into railsware:main Dec 21, 2025
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.

Minor warning when building with vite

2 participants