fix(builder): add OXC semantic to deconflic JS modules using the same global variables/functions
- this solve issues like: Uncaught SyntaxError: Identifier 'GROUP_BY_DEFS' has already been declared (at app.XXXX.js)
- add a protection on build: test to reload bundled app, on failure exit immediately (prevent the build or a broken bundle)
- add final check during CI: node --check on the bundle to brevent going to production too if any failure
example of a bundle:
```
warning: oxicloud@0.6.0: bundle: 50 files in dependency order:
warning: oxicloud@0.6.0: bundle: deconflicting 2 name(s): GROUP_BY_DEFS, LOAD_MORE_ID
warning: oxicloud@0.6.0: bundle: [29] GROUP_BY_DEFS -> GROUP_BY_DEFS_29 (favoritesView.js)
warning: oxicloud@0.6.0: bundle: [29] LOAD_MORE_ID -> LOAD_MORE_ID_29 (favoritesView.js)
warning: oxicloud@0.6.0: bundle: [31] GROUP_BY_DEFS -> GROUP_BY_DEFS_31 (recentView.js)
warning: oxicloud@0.6.0: bundle: [31] LOAD_MORE_ID -> LOAD_MORE_ID_31 (recentView.js)
warning: oxicloud@0.6.0: bundle: [34] GROUP_BY_DEFS -> GROUP_BY_DEFS_34 (sharedWithMeView.js)
warning: oxicloud@0.6.0: bundle: [34] LOAD_MORE_ID -> LOAD_MORE_ID_34 (sharedWithMeView.js)
warning: oxicloud@0.6.0: bundle: [44] GROUP_BY_DEFS -> GROUP_BY_DEFS_44 (filesView.js)
warning: oxicloud@0.6.0: bundle: [44] LOAD_MORE_ID -> LOAD_MORE_ID_44 (filesView.js)
```
This commit is contained in:
Generated
+1
@@ -3692,6 +3692,7 @@ dependencies = [
|
||||
"oxc_codegen",
|
||||
"oxc_minifier",
|
||||
"oxc_parser",
|
||||
"oxc_semantic",
|
||||
"oxc_span",
|
||||
"percent-encoding",
|
||||
"quick-xml 0.39.2",
|
||||
|
||||
Reference in New Issue
Block a user