-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
[Bug]: Backbone + rspack #7107
Comments
🤔 I install backbone and jquery, build and run your |
test.zip |
The way outBump backbone up to at least 1.2.0. Why Backbone 1.1.2 will not work as expected1. Why
|
In addition, this case works with webpack as webpack has a builtin amd support while rspack doesn't (#4313). To reproduce this case with webpack, add |
@xc2 Thank you very much for the great explanation |
I'm closing this issue for:
Please feel free to continue this thread if you have any more questions about this case. |
System Info
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M1 Pro
Memory: 98.14 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: 4.0.0 - ~/.nvm/versions/node/v18.18.2/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
Browsers:
Chrome: 126.0.6478.127
Safari: 17.5
npmPackages:
@rspack/cli: ^0.7.5 => 0.7.5
@rspack/core: ^0.7.5 => 0.7.5
Details
I want to migrate from webpack 5 to rspack in my project in which I use Backbone + Marionette (it's a legacy project) but jquery that is a dependency of backbone and marionette seems undefined inside backbone. this is an example I created:
main.js
import $ from 'jquery'; // this can be optional using ProvidePlugin
import Backbone from 'backbone';
console.log(Backbone)
this is the console.log:
![Screenshot 2024-07-10 alle 13 21 54](https://private-user-images.githubusercontent.com/768952/347379812-9ddfc04f-6c66-40ca-b444-2618292d4e9a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNzI4NzEsIm5iZiI6MTcyMzA3MjU3MSwicGF0aCI6Ii83Njg5NTIvMzQ3Mzc5ODEyLTlkZGZjMDRmLTZjNjYtNDBjYS1iNDQ0LTI2MTgyOTJkNGU5YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwN1QyMzE2MTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01N2E1OTFjYmY1YWRhNTNlOWUyMTY2MmZmMTlhODU1ZDhmM2E1OWRiYjMyNDc0NTNmODBlMmZmMGVhZDU5NzZlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.08Z2cmjcQQZL16Oi9lOyiSWSZnUG7bAIsDLAnRgl2EU)
as you can see it's undefined, backbone use an UMD for modules, I don't if this change anything, in Webpack this is working, what I'm missing?
Reproduce link
No response
Reproduce Steps
rspack build
The text was updated successfully, but these errors were encountered: