-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
Draft: fix: align amd
option behavior with webpack
#9011
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -372,7 +372,7 @@ export const getNormalizedRspackOptions = ( | |||
watchOptions: cloneObject(config.watchOptions), | |||
devServer: config.devServer, | |||
profile: config.profile, | |||
amd: config.amd ? JSON.stringify(config.amd) : undefined, | |||
amd: config.amd !== false ? JSON.stringify(config.amd || {}) : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack does not explicitly specify a default value for amd
option. however, undefined
is equivalent to {}
in the implementation. ref
this change ensures the behavior is consistent with webpack. but i'm wondering if we should explicitly state the default value is {}
. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this line to getRawOptions
.
CodSpeed Performance ReportMerging #9011 will not alter performanceComparing Summary
|
amd
option behavior with webpack and add doc for amd
optionamd
option behavior with webpack
amd
option behavior with webpackamd
option behavior with webpack
415b69c
to
a13a6da
Compare
_expr: &swc_core::ecma::ast::CallExpr, | ||
for_name: &str, | ||
) -> Option<bool> { | ||
(parser.is_esm && is_non_esm_identifier(for_name)).then_some(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the module is an esm, define
/typeof define
/define(...)
processing will be skipped by HarmonyDetectionParserPlugin.
a13a6da
to
c0460c7
Compare
chore(normal/parsing/unsupport-require-property): require.amd should not be undefined now chore(normal/parsing/unsupport-require-property): require.version & require.onError to be discussed
chore: add more test cases for amd require
c0460c7
to
7431665
Compare
Summary
closes #8987
amd
option behavior with webpackamd
optionChecklist