@modern-js/plugin-module-import 2.19.1 → 2.21.0
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 +23 -0
- package/dist/cjs/index.js +2 -41
- package/dist/types/index.d.ts +0 -2
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @modern-js/plugin-module-import
|
|
2
2
|
|
|
3
|
+
## 2.21.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 26dcf3a: chore: bump typescript to v5 in devDependencies
|
|
8
|
+
|
|
9
|
+
chore: 升级 devDependencies 中的 typescript 版本到 v5
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [df43559]
|
|
12
|
+
- Updated dependencies [26dcf3a]
|
|
13
|
+
- Updated dependencies [ad78387]
|
|
14
|
+
- @modern-js/module-tools@2.21.0
|
|
15
|
+
|
|
16
|
+
## 2.20.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 6b9d90a: chore: remove @babel/runtime. add @swc/helper and enable `externalHelper` config.
|
|
21
|
+
chore: 移除 @babel/runtime 依赖. 增加 @swc/helpers 依赖并且开启 `externalHelpers` 配置
|
|
22
|
+
- Updated dependencies [6b9d90a]
|
|
23
|
+
- Updated dependencies [6b9d90a]
|
|
24
|
+
- @modern-js/module-tools@2.20.0
|
|
25
|
+
|
|
3
26
|
## 2.19.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,47 +6,8 @@ Object.defineProperty(exports, "default", {
|
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: () => _default
|
|
8
8
|
});
|
|
9
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
9
10
|
const _libuildpluginswc = require("@modern-js/libuild-plugin-swc");
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
11
|
-
if (typeof WeakMap !== "function")
|
|
12
|
-
return null;
|
|
13
|
-
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
14
|
-
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
15
|
-
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
16
|
-
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
17
|
-
})(nodeInterop);
|
|
18
|
-
}
|
|
19
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
20
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
21
|
-
return obj;
|
|
22
|
-
}
|
|
23
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
24
|
-
return {
|
|
25
|
-
default: obj
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
29
|
-
if (cache && cache.has(obj)) {
|
|
30
|
-
return cache.get(obj);
|
|
31
|
-
}
|
|
32
|
-
var newObj = {};
|
|
33
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
34
|
-
for (var key in obj) {
|
|
35
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
36
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
37
|
-
if (desc && (desc.get || desc.set)) {
|
|
38
|
-
Object.defineProperty(newObj, key, desc);
|
|
39
|
-
} else {
|
|
40
|
-
newObj[key] = obj[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
newObj.default = obj;
|
|
45
|
-
if (cache) {
|
|
46
|
-
cache.set(obj, newObj);
|
|
47
|
-
}
|
|
48
|
-
return newObj;
|
|
49
|
-
}
|
|
50
11
|
const _default = (options) => {
|
|
51
12
|
return {
|
|
52
13
|
name: "@modern-js/plugin-module-import",
|
|
@@ -65,7 +26,7 @@ const _default = (options) => {
|
|
|
65
26
|
if (!options.pluginImport || options.pluginImport.length === 0) {
|
|
66
27
|
return next(config);
|
|
67
28
|
}
|
|
68
|
-
const { transformPlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard(require("@modern-js/libuild-plugin-swc")));
|
|
29
|
+
const { transformPlugin } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/libuild-plugin-swc")));
|
|
69
30
|
var _options_pluginImport;
|
|
70
31
|
(_config_plugins1 = config.plugins) === null || _config_plugins1 === void 0 ? void 0 : _config_plugins1.push(transformPlugin({
|
|
71
32
|
jsc: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
2
|
import type { ImportItem } from '@modern-js/libuild-plugin-swc';
|
|
3
|
-
|
|
4
3
|
declare const _default: (options: {
|
|
5
4
|
pluginImport?: ImportItem[];
|
|
6
5
|
}) => CliPlugin<ModuleTools>;
|
|
7
|
-
|
|
8
6
|
export default _default;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.21.0",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -29,20 +29,21 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@modern-js/libuild-plugin-swc": "0.12.2"
|
|
32
|
+
"@modern-js/libuild-plugin-swc": "0.12.2",
|
|
33
|
+
"@swc/helpers": "0.5.1"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@types/jest": "^29",
|
|
36
37
|
"@types/node": "^14",
|
|
37
|
-
"typescript": "^
|
|
38
|
+
"typescript": "^5",
|
|
38
39
|
"jest": "^29",
|
|
39
40
|
"@modern-js/libuild": "0.12.2",
|
|
40
|
-
"@scripts/
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
41
|
+
"@scripts/jest-config": "2.21.0",
|
|
42
|
+
"@modern-js/module-tools": "2.21.0",
|
|
43
|
+
"@scripts/build": "2.21.0"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"@modern-js/module-tools": "^2.
|
|
46
|
+
"@modern-js/module-tools": "^2.21.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependenciesMeta": {
|
|
48
49
|
"@modern-js/module-tools": {
|