@modern-js/plugin-polyfill 1.21.4 → 1.21.6

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,5 +1,21 @@
1
1
  # @modern-js/plugin-polyfill
2
2
 
3
+ ## 1.21.6
4
+
5
+ ### Patch Changes
6
+
7
+ - @modern-js/utils@1.21.6
8
+
9
+ ## 1.21.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 2971dd6: fix(plugin-polyfill): failed to join flags when restart CLI
14
+
15
+ fix(plugin-polyfill): 修复重启 CLI 时报错 join flags 失败的问题
16
+
17
+ - @modern-js/utils@1.21.5
18
+
3
19
  ## 1.21.4
4
20
 
5
21
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  export const defaultPolyfill = '/__polyfill__';
2
- export const defaultFeatures = {
2
+ export const getDefaultFeatures = () => ({
3
3
  es6: {
4
4
  flags: ['gated']
5
5
  }
6
- };
6
+ });
@@ -1,7 +1,7 @@
1
1
  import { getPolyfillString } from '@modern-js/polyfill-lib';
2
2
  import { mime } from '@modern-js/utils';
3
3
  import Parser from 'ua-parser-js';
4
- import { defaultFeatures, defaultPolyfill } from "./const";
4
+ import { getDefaultFeatures, defaultPolyfill } from "./const";
5
5
  import PolyfillCache, { generateCacheKey } from "./libs/cache";
6
6
  export default (() => ({
7
7
  name: '@modern-js/plugin-polyfill',
@@ -9,7 +9,7 @@ export default (() => ({
9
9
  beforeProdServer() {
10
10
  const cache = new PolyfillCache();
11
11
  const route = defaultPolyfill;
12
- const features = defaultFeatures;
12
+ const features = getDefaultFeatures();
13
13
  const minify = process.env.NODE_ENV === 'production';
14
14
  const featureDig = Object.keys(features).map(name => {
15
15
  const {
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.defaultPolyfill = exports.defaultFeatures = void 0;
6
+ exports.getDefaultFeatures = exports.defaultPolyfill = void 0;
7
7
  const defaultPolyfill = '/__polyfill__';
8
8
  exports.defaultPolyfill = defaultPolyfill;
9
- const defaultFeatures = {
9
+
10
+ const getDefaultFeatures = () => ({
10
11
  es6: {
11
12
  flags: ['gated']
12
13
  }
13
- };
14
- exports.defaultFeatures = defaultFeatures;
14
+ });
15
+
16
+ exports.getDefaultFeatures = getDefaultFeatures;
@@ -27,7 +27,7 @@ var _default = () => ({
27
27
  beforeProdServer() {
28
28
  const cache = new _cache.default();
29
29
  const route = _const.defaultPolyfill;
30
- const features = _const.defaultFeatures;
30
+ const features = (0, _const.getDefaultFeatures)();
31
31
  const minify = process.env.NODE_ENV === 'production';
32
32
  const featureDig = Object.keys(features).map(name => {
33
33
  const {
@@ -1,4 +1,4 @@
1
1
  export declare const defaultPolyfill = "/__polyfill__";
2
- export declare const defaultFeatures: Record<string, {
2
+ export declare const getDefaultFeatures: () => Record<string, {
3
3
  flags: string[];
4
4
  }>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.21.4",
14
+ "version": "1.21.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -37,23 +37,23 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7.18.0",
40
- "@modern-js/utils": "1.21.4",
41
40
  "@modern-js/polyfill-lib": "^1.0.0",
42
41
  "lru-cache": "^6.0.0",
43
- "ua-parser-js": "^0.7.28"
42
+ "ua-parser-js": "^0.7.28",
43
+ "@modern-js/utils": "1.21.6"
44
44
  },
45
45
  "devDependencies": {
46
- "@modern-js/server-core": "1.21.4",
47
- "@modern-js/types": "1.21.4",
48
46
  "@types/jest": "^27",
49
47
  "@types/lru-cache": "^5.1.1",
50
48
  "@types/node": "^14",
51
49
  "@types/ua-parser-js": "^0.7.36",
52
50
  "typescript": "^4",
53
- "@modern-js/core": "1.21.4",
54
- "@scripts/build": "1.21.4",
55
51
  "jest": "^27",
56
- "@scripts/jest-config": "1.21.4"
52
+ "@modern-js/server-core": "1.21.6",
53
+ "@modern-js/types": "1.21.6",
54
+ "@modern-js/core": "1.21.6",
55
+ "@scripts/build": "1.21.6",
56
+ "@scripts/jest-config": "1.21.6"
57
57
  },
58
58
  "sideEffects": false,
59
59
  "modernConfig": {