@modern-js/plugin-module-polyfill 0.0.0-next-1685343732023 → 0.0.0-next-1685383616364

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
@@ -1,16 +1,19 @@
1
1
  # @modern-js/plugin-module-polyfill
2
2
 
3
- ## 0.0.0-next-1685343732023
3
+ ## 0.0.0-next-1685383616364
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 3d48836b30: chore(deps): fix all missing peer dependencies
7
+ - 3d48836b3: chore(deps): fix all missing peer dependencies
8
8
 
9
9
  chore(deps): 修复缺少的 peer dependencies
10
10
 
11
- - 5cbe8b5860: fix: unable parsing within a ts ambient context, and set plugin options optional
11
+ - 5cbe8b586: fix: unable parsing within a ts ambient context, and set plugin options optional
12
12
  fix: 关闭在 ts 环境中的解析,并将插件参数设为可选
13
- - @modern-js/module-tools@0.0.0-next-1685343732023
13
+ - e2913dd55: chore: update module plugin docs and readme
14
+ chore: 更新模块插件的文档和 readme
15
+ - Updated dependencies [56837a60e]
16
+ - @modern-js/module-tools@0.0.0-next-1685383616364
14
17
 
15
18
  ## 2.21.1
16
19
 
package/README.md CHANGED
@@ -9,14 +9,18 @@ A Library author don't want to "pollute" the global scope with the polyfills you
9
9
  ## Usage
10
10
 
11
11
  ```ts
12
- import { defineConfig } from '@modern-js/module-tools';
13
- import { ModulePolyfillPlugin } from '@modern-js/plugin-module-polyfill';
12
+ import moduleTools, { defineConfig } from '@modern-js/module-tools';
13
+ import { modulePluginPolyfill } from '@modern-js/plugin-module-polyfill';
14
+
14
15
  export default defineConfig({
15
- plugins: [ModulePolyfillPlugin({
16
- targets: {
17
- ios: '9';
18
- }
19
- })],
16
+ plugins: [
17
+ moduleTools(),
18
+ modulePluginPolyfill({
19
+ targets: {
20
+ ios: '9';
21
+ }
22
+ })
23
+ ],
20
24
  });
21
25
  ```
22
26
 
package/dist/index.d.ts CHANGED
@@ -4,4 +4,4 @@ declare const ModulePolyfillPlugin: (options?: {
4
4
  targets?: Record<string, string> | string;
5
5
  }) => CliPlugin<ModuleTools>;
6
6
 
7
- export { ModulePolyfillPlugin };
7
+ export { ModulePolyfillPlugin, ModulePolyfillPlugin as modulePluginPolyfill };
package/dist/index.js CHANGED
@@ -19,7 +19,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/index.ts
20
20
  var src_exports = {};
21
21
  __export(src_exports, {
22
- ModulePolyfillPlugin: () => ModulePolyfillPlugin
22
+ ModulePolyfillPlugin: () => ModulePolyfillPlugin,
23
+ modulePluginPolyfill: () => ModulePolyfillPlugin
23
24
  });
24
25
  module.exports = __toCommonJS(src_exports);
25
26
  var import_libuild_plugin_babel = require("@modern-js/libuild-plugin-babel");
@@ -50,7 +51,8 @@ var ModulePolyfillPlugin = (options) => ({
50
51
  });
51
52
  // Annotate the CommonJS export names for ESM import in node:
52
53
  0 && (module.exports = {
53
- ModulePolyfillPlugin
54
+ ModulePolyfillPlugin,
55
+ modulePluginPolyfill
54
56
  });
55
57
 
56
58
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kCAA4B;AAErB,IAAM,uBAAuB,CAAC,aAEN;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO,OAAO;AAAA,IACZ,cAAc,QAAQ;AAR1B;AASM,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\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"]}
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-1685343732023",
18
+ "version": "0.0.0-next-1685383616364",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/index.js",
21
21
  "devDependencies": {
@@ -23,12 +23,12 @@
23
23
  "@types/node": "^14",
24
24
  "typescript": "^5",
25
25
  "jest": "^29",
26
- "@scripts/build": "0.0.0-next-1685343732023",
27
- "@modern-js/module-tools": "0.0.0-next-1685343732023",
28
- "@scripts/jest-config": "0.0.0-next-1685343732023"
26
+ "@scripts/build": "0.0.0-next-1685383616364",
27
+ "@scripts/jest-config": "0.0.0-next-1685383616364",
28
+ "@modern-js/module-tools": "0.0.0-next-1685383616364"
29
29
  },
30
30
  "peerDependencies": {
31
- "@modern-js/module-tools": "0.0.0-next-1685343732023",
31
+ "@modern-js/module-tools": "0.0.0-next-1685383616364",
32
32
  "core-js-pure": "^3.25.0"
33
33
  },
34
34
  "dependencies": {