@modern-js/plugin-module-node-polyfill 2.27.0 → 2.29.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/dist/index.d.ts +3 -6
- package/dist/index.js +13 -33
- package/package.json +7 -6
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
|
-
import { NodePolyfillPluginOptions } from '@modern-js/libuild-plugin-node-polyfill';
|
|
3
|
-
|
|
4
|
-
declare const modulePluginNodePolyfill: (polyfillOption?: NodePolyfillPluginOptions) => CliPlugin<ModuleTools>;
|
|
5
|
-
|
|
6
|
-
export { modulePluginNodePolyfill };
|
|
1
|
+
import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
|
|
2
|
+
import type { NodePolyfillPluginOptions } from '@modern-js/libuild-plugin-node-polyfill';
|
|
3
|
+
export declare const modulePluginNodePolyfill: (polyfillOption?: NodePolyfillPluginOptions) => CliPlugin<ModuleTools>;
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "modulePluginNodePolyfill", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return modulePluginNodePolyfill;
|
|
14
9
|
}
|
|
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
|
-
modulePluginNodePolyfill: () => modulePluginNodePolyfill
|
|
23
10
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var modulePluginNodePolyfill = (polyfillOption = {}) => ({
|
|
11
|
+
const _libuildpluginnodepolyfill = require("@modern-js/libuild-plugin-node-polyfill");
|
|
12
|
+
const modulePluginNodePolyfill = (polyfillOption = {}) => ({
|
|
27
13
|
name: "polyfill-plugin",
|
|
28
14
|
setup() {
|
|
29
15
|
return {
|
|
30
16
|
modifyLibuild(config, next) {
|
|
31
|
-
var
|
|
17
|
+
var _config_plugins;
|
|
32
18
|
config.plugins = [
|
|
33
|
-
...(
|
|
34
|
-
(0,
|
|
19
|
+
...(_config_plugins = config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [],
|
|
20
|
+
(0, _libuildpluginnodepolyfill.nodePolyfillPlugin)(polyfillOption)
|
|
35
21
|
];
|
|
36
22
|
return next(config);
|
|
37
23
|
}
|
|
38
24
|
};
|
|
39
25
|
}
|
|
40
26
|
});
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
modulePluginNodePolyfill
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.29.0",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"devDependencies": {
|
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
"@types/node": "^14",
|
|
24
24
|
"typescript": "^5",
|
|
25
25
|
"jest": "^29",
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
26
|
+
"@swc/helpers": "0.5.1",
|
|
27
|
+
"@modern-js/module-tools": "2.29.0",
|
|
28
|
+
"@scripts/jest-config": "2.29.0",
|
|
29
|
+
"@scripts/build": "2.29.0"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
|
-
"@modern-js/module-tools": "^2.
|
|
32
|
+
"@modern-js/module-tools": "^2.29.0"
|
|
32
33
|
},
|
|
33
34
|
"peerDependenciesMeta": {
|
|
34
35
|
"@modern-js/module-tools": {
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@modern-js/libuild-plugin-node-polyfill": "0.
|
|
40
|
+
"@modern-js/libuild-plugin-node-polyfill": "0.14.3"
|
|
40
41
|
},
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"registry": "https://registry.npmjs.org/",
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0CAAmC;AAE5B,IAAM,2BAA2B,CACtC,iBAA4C,CAAC,OACjB;AAAA,EAC5B,MAAM;AAAA,EACN,QAAQ;AACN,WAAO;AAAA,MACL,cAAc,QAAQ,MAAM;AAVlC;AAWQ,eAAO,UAAU;AAAA,UACf,IAAI,YAAO,YAAP,YAAkB,CAAC;AAAA,cACvB,wDAAmB,cAAc;AAAA,QACnC;AACA,eAAO,KAAK,MAAM;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';\nimport type { NodePolyfillPluginOptions } from '@modern-js/libuild-plugin-node-polyfill';\nimport { nodePolyfillPlugin } from '@modern-js/libuild-plugin-node-polyfill';\n\nexport const modulePluginNodePolyfill = (\n polyfillOption: NodePolyfillPluginOptions = {},\n): CliPlugin<ModuleTools> => ({\n name: 'polyfill-plugin',\n setup() {\n return {\n modifyLibuild(config, next) {\n config.plugins = [\n ...(config.plugins ?? []),\n nodePolyfillPlugin(polyfillOption),\n ];\n return next(config);\n },\n };\n },\n});\n"]}
|