babel-plugin-transform-modules-ui5 7.1.2 → 7.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.1.3](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.2...v7.1.3) (2023-04-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * dynamic import must not handle __esModule flagged modules ([#93](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/93)) ([b269985](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/b26998540cac0c2c2868bd59198d6f9abfaab8f7))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [7.1.2](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.1...v7.1.2) (2023-04-11)
7
18
 
8
19
 
@@ -142,6 +142,14 @@ const buildDefaultImportDeconstructor = (0, _core.template)(`
142
142
  *
143
143
  * (await import("./non/exporting/module")) => { __esModule: true, ... }
144
144
  * (await import("./non/exporting/module")) => undefined
145
+ *
146
+ * 5.) Other dependencies (jsPDF)
147
+ *
148
+ * (await import("jsPDF")) => { __esModule: true, jsPDF: ?, ... }
149
+ * (await import("sap/m/MessageBox")).jsPDF => jsPDF
150
+ *
151
+ * When requiring other dependencies they are already flagged as __esModule
152
+ * and must not be processed in our dynamic import to require handler.
145
153
  */
146
154
  // TODO: inject __extends instead of Object.assign unless useBuiltIns in set
147
155
  exports.buildDefaultImportDeconstructor = buildDefaultImportDeconstructor;
@@ -149,8 +157,8 @@ const buildDynamicImportHelper = (0, _core.template)(`
149
157
  function __ui5_require_async(path) {
150
158
  return new Promise((resolve, reject) => {
151
159
  sap.ui.require([path], (module) => {
152
- module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? { default: module } : module;
153
160
  if (!module.__esModule) {
161
+ module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? { default: module } : module;
154
162
  Object.defineProperty(module, "__esModule", { value: true });
155
163
  }
156
164
  resolve(module);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-transform-modules-ui5",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "description": "An unofficial babel plugin for SAP UI5.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -92,5 +92,5 @@
92
92
  "prettier": "^2.8.4",
93
93
  "rimraf": "^4.1.2"
94
94
  },
95
- "gitHead": "f3aa113c8c8a0294648e93c466e1e298593b4c35"
95
+ "gitHead": "54a5521dea19fedd9cd53f7aeabc5e383e926303"
96
96
  }