@modern-js/plugin-module-polyfill 0.0.0-next-1690343545318 → 0.0.0-next-1690345473644
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 +2 -8
- package/dist/index.d.ts +6 -4
- package/dist/index.js +54 -50
- package/dist/index.js.map +1 -0
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
# @modern-js/plugin-module-polyfill
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-1690345473644
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
chore(CI): 更新构建配置来提升 vitest CI 性能
|
|
10
|
-
|
|
11
|
-
- Updated dependencies [3092f1fc9]
|
|
12
|
-
- Updated dependencies [d3e52e4f6]
|
|
13
|
-
- @modern-js/module-tools@0.0.0-next-1690343545318
|
|
7
|
+
- @modern-js/module-tools@0.0.0-next-1690345473644
|
|
14
8
|
|
|
15
9
|
## 2.27.0
|
|
16
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
|
+
|
|
3
|
+
declare const ModulePolyfillPlugin: (options?: {
|
|
4
|
+
targets?: Record<string, string> | string;
|
|
4
5
|
}) => CliPlugin<ModuleTools>;
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
export { ModulePolyfillPlugin, ModulePolyfillPlugin as modulePluginPolyfill };
|
package/dist/index.js
CHANGED
|
@@ -1,54 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
6
|
for (var name in all)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return ModulePolyfillPlugin;
|
|
15
|
-
},
|
|
16
|
-
modulePluginPolyfill: function() {
|
|
17
|
-
return ModulePolyfillPlugin;
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
14
|
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
ModulePolyfillPlugin: () => ModulePolyfillPlugin,
|
|
23
|
+
modulePluginPolyfill: () => ModulePolyfillPlugin
|
|
19
24
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
]
|
|
45
|
-
];
|
|
46
|
-
(_config_plugins = config.plugins) === null || _config_plugins === void 0 ? void 0 : _config_plugins.push((0, _libuildpluginbabel.babelPlugin)({
|
|
47
|
-
plugins
|
|
48
|
-
}));
|
|
49
|
-
return config;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var import_libuild_plugin_babel = require("@modern-js/libuild-plugin-babel");
|
|
27
|
+
var ModulePolyfillPlugin = (options) => ({
|
|
28
|
+
name: "@modern-js/plugin-module-polyfill",
|
|
29
|
+
setup: () => ({
|
|
30
|
+
modifyLibuild(config) {
|
|
31
|
+
var _a;
|
|
32
|
+
const plugins = [
|
|
33
|
+
[require("@babel/plugin-syntax-typescript"), { isTSX: true }],
|
|
34
|
+
[require("@babel/plugin-syntax-jsx")],
|
|
35
|
+
[
|
|
36
|
+
require("babel-plugin-polyfill-corejs3"),
|
|
37
|
+
{
|
|
38
|
+
method: "usage-pure",
|
|
39
|
+
targets: options == null ? void 0 : options.targets
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
];
|
|
43
|
+
(_a = config.plugins) == null ? void 0 : _a.push(
|
|
44
|
+
(0, import_libuild_plugin_babel.babelPlugin)({
|
|
45
|
+
plugins
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
return config;
|
|
52
49
|
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
ModulePolyfillPlugin,
|
|
55
|
+
modulePluginPolyfill
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kCAA4B;AAGrB,IAAM,uBAAuB,CAAC,aAEN;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO,OAAO;AAAA,IACZ,cAAc,QAAQ;AAT1B;AAUM,YAAM,UAAU;AAAA,QACd,CAAC,QAAQ,iCAAiC,GAAG,EAAE,OAAO,KAAK,CAAC;AAAA,QAC5D,CAAC,QAAQ,0BAA0B,CAAC;AAAA,QACpC;AAAA,UACE,QAAQ,+BAA+B;AAAA,UACvC;AAAA,YACE,QAAQ;AAAA,YACR,SAAS,mCAAS;AAAA,UACpB;AAAA,QACF;AAAA,MACF;AACA,mBAAO,YAAP,mBAAgB;AAAA,YACd,yCAAY;AAAA,UACV;AAAA,QACF,CAAC;AAAA;AAEH,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\nimport { babelPlugin } from '@modern-js/libuild-plugin-babel';\n\n// deprecated named export\nexport const ModulePolyfillPlugin = (options?: {\n targets?: Record<string, string> | string;\n}): CliPlugin<ModuleTools> => ({\n name: '@modern-js/plugin-module-polyfill',\n setup: () => ({\n modifyLibuild(config) {\n const plugins = [\n [require('@babel/plugin-syntax-typescript'), { isTSX: true }],\n [require('@babel/plugin-syntax-jsx')],\n [\n require('babel-plugin-polyfill-corejs3'),\n {\n method: 'usage-pure',\n targets: options?.targets,\n },\n ],\n ];\n config.plugins?.push(\n babelPlugin({\n plugins,\n }),\n );\n return config;\n },\n }),\n});\n\n// right named export\nexport { ModulePolyfillPlugin as modulePluginPolyfill };\n"]}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-next-
|
|
18
|
+
"version": "0.0.0-next-1690345473644",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"devDependencies": {
|
|
@@ -23,13 +23,12 @@
|
|
|
23
23
|
"@types/node": "^14",
|
|
24
24
|
"typescript": "^5",
|
|
25
25
|
"jest": "^29",
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@scripts/jest-config": "0.0.0-next-
|
|
29
|
-
"@modern-js/module-tools": "0.0.0-next-1690343545318"
|
|
26
|
+
"@scripts/build": "0.0.0-next-1690345473644",
|
|
27
|
+
"@modern-js/module-tools": "0.0.0-next-1690345473644",
|
|
28
|
+
"@scripts/jest-config": "0.0.0-next-1690345473644"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|
|
32
|
-
"@modern-js/module-tools": "0.0.0-next-
|
|
31
|
+
"@modern-js/module-tools": "0.0.0-next-1690345473644",
|
|
33
32
|
"core-js-pure": "^3.25.0"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|