@modern-js/plugin-module-polyfill 2.21.2-beta.0 → 2.22.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @modern-js/plugin-module-polyfill
2
2
 
3
+ ## 2.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @modern-js/module-tools@2.22.1
8
+
9
+ ## 2.22.0
10
+
11
+ ### Patch Changes
12
+
13
+ - 3d48836: chore(deps): fix all missing peer dependencies
14
+
15
+ chore(deps): 修复缺少的 peer dependencies
16
+
17
+ - 5cbe8b5: fix: unable parsing within a ts ambient context, and set plugin options optional
18
+ fix: 关闭在 ts 环境中的解析,并将插件参数设为可选
19
+ - ad49140: chore: adjust output and package.json fields
20
+ chore: 调整包的产物格式以及 packgae.json 里的字段
21
+ - e2913dd: chore: update module plugin docs and readme
22
+ chore: 更新模块插件的文档和 readme
23
+ - Updated dependencies [d19dc11]
24
+ - Updated dependencies [c890980]
25
+ - Updated dependencies [4b7488c]
26
+ - @modern-js/module-tools@2.22.0
27
+
3
28
  ## 2.21.1
4
29
 
5
30
  ### Patch Changes
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,26 +15,27 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.21.2-beta.0",
19
- "types": "./dist/types/index.d.ts",
18
+ "version": "2.22.1",
19
+ "types": "./dist/index.d.ts",
20
20
  "main": "./dist/index.js",
21
21
  "devDependencies": {
22
22
  "@types/jest": "^29",
23
23
  "@types/node": "^14",
24
24
  "typescript": "^5",
25
25
  "jest": "^29",
26
- "@scripts/build": "2.21.1",
27
- "@scripts/jest-config": "2.21.1",
28
- "@modern-js/module-tools": "2.21.1"
26
+ "@scripts/jest-config": "2.22.1",
27
+ "@scripts/build": "2.22.1",
28
+ "@modern-js/module-tools": "2.22.1"
29
29
  },
30
30
  "peerDependencies": {
31
- "@modern-js/module-tools": "^2.21.1",
31
+ "@modern-js/module-tools": "^2.22.1",
32
32
  "core-js-pure": "^3.25.0"
33
33
  },
34
34
  "dependencies": {
35
- "@modern-js/libuild-plugin-babel": "0.7.1",
35
+ "@babel/core": "^7.21.8",
36
36
  "@babel/plugin-syntax-typescript": "7.21.4",
37
37
  "@babel/plugin-syntax-jsx": "7.21.4",
38
+ "@modern-js/libuild-plugin-babel": "0.7.1",
38
39
  "babel-plugin-polyfill-corejs3": "0.5.2"
39
40
  },
40
41
  "sideEffects": false,