@modern-js/builder 2.4.1-beta.0 → 2.5.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/CHANGELOG.md CHANGED
@@ -1,18 +1,28 @@
1
1
  # @modern-js/builder
2
2
 
3
- ## 2.4.1-beta.0
3
+ ## 2.5.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - 442204a: fix(builder): should not open startUrl multiple times
8
+
9
+ fix(builder): 修复 startUrl 被重复打开的问题
10
+
11
+ - 30614fa: chore: modify package.json entry fields and build config
12
+ chore: 更改 package.json entry 字段以及构建配置
7
13
  - c4c10e7: refactor: refactor rules for static assets processing with rule.oneOf, reuse svg/font/image/media plugin
8
14
 
9
15
  refactor: 使用 oneOf 重构静态资源处理规则 & 复用 svg / font / media / img 插件
10
16
 
17
+ - Updated dependencies [58a9918]
18
+ - Updated dependencies [30614fa]
11
19
  - Updated dependencies [c4c10e7]
20
+ - Updated dependencies [1b0ce87]
12
21
  - Updated dependencies [11c053b]
13
22
  - Updated dependencies [28e7dc6]
14
- - @modern-js/builder-shared@2.5.0-beta.0
15
- - @modern-js/utils@2.4.1-beta.0
23
+ - Updated dependencies [40230b3]
24
+ - @modern-js/builder-shared@2.5.0
25
+ - @modern-js/utils@2.5.0
16
26
 
17
27
  ## 2.4.0
18
28
 
@@ -30,6 +30,7 @@ exports.builderPluginStartUrl = exports.replacePlaceholder = void 0;
30
30
  const lodash_1 = __importDefault(require("@modern-js/utils/lodash"));
31
31
  const replacePlaceholder = (url, port) => url.replace(/<port>/g, String(port));
32
32
  exports.replacePlaceholder = replacePlaceholder;
33
+ const openedURLs = [];
33
34
  function builderPluginStartUrl() {
34
35
  return {
35
36
  name: 'builder-plugin-start-url',
@@ -57,7 +58,14 @@ function builderPluginStartUrl() {
57
58
  }
58
59
  const { openBrowser } = await Promise.resolve().then(() => __importStar(require('@modern-js/builder-shared')));
59
60
  for (const url of urls) {
60
- await openBrowser(url);
61
+ /**
62
+ * If a URL has been opened in current process, we will not open it again.
63
+ * It can prevent opening the same URL multiple times.
64
+ */
65
+ if (!openedURLs.includes(url)) {
66
+ await openBrowser(url);
67
+ openedURLs.push(url);
68
+ }
61
69
  }
62
70
  });
63
71
  },
package/package.json CHANGED
@@ -14,12 +14,11 @@
14
14
  "engines": {
15
15
  "node": ">=14.0.0"
16
16
  },
17
- "version": "2.4.1-beta.0",
17
+ "version": "2.5.0",
18
18
  "jsnext:source": "./src/index.ts",
19
19
  "types": "./dist/index.d.ts",
20
20
  "main": "./dist/index.js",
21
21
  "module": "./dist/index.js",
22
- "jsnext:modern": "./dist/index.js",
23
22
  "exports": {
24
23
  ".": {
25
24
  "jsnext:source": "./src/index.ts",
@@ -28,8 +27,8 @@
28
27
  },
29
28
  "dependencies": {
30
29
  "@svgr/webpack": "6.5.1",
31
- "@modern-js/builder-shared": "2.5.0-beta.0",
32
- "@modern-js/utils": "2.4.1-beta.0"
30
+ "@modern-js/builder-shared": "2.5.0",
31
+ "@modern-js/utils": "2.5.0"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@babel/core": "7.18.0",
@@ -37,7 +36,7 @@
37
36
  "@types/babel__preset-env": "^7.9.2",
38
37
  "@types/node": "^14",
39
38
  "typescript": "^4",
40
- "@scripts/vitest-config": "2.4.1-beta.0"
39
+ "@scripts/vitest-config": "2.5.0"
41
40
  },
42
41
  "publishConfig": {
43
42
  "registry": "https://registry.npmjs.org/",