@jayfong/x-server 1.11.2 → 1.11.3

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.11.3](https://github.com/jfWorks/x-server/compare/v1.11.2...v1.11.3) (2022-04-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * mainFields ([80fd62d](https://github.com/jfWorks/x-server/commit/80fd62d3973f556a83dc7bf1930e5bb06c6845ec))
11
+
5
12
  ### [1.11.2](https://github.com/jfWorks/x-server/compare/v1.11.1...v1.11.2) (2022-04-20)
6
13
 
7
14
 
@@ -61,6 +61,11 @@ class BuildUtil {
61
61
  bundle: true,
62
62
  outfile: distMainFile,
63
63
  platform: 'node',
64
+ // https://esbuild.github.io/api/#main-fields
65
+ // 当 platform 是 node 时,
66
+ // esbuild 默认的 mainFields 是 main,module,
67
+ // 这会导致 treeShaking 失效
68
+ mainFields: ['module', 'main'],
64
69
  target: `node${process.version.slice(1)}`,
65
70
  external: external,
66
71
  minify: (_options$minify = options.minify) != null ? _options$minify : true,
@@ -37,6 +37,11 @@ export class BuildUtil {
37
37
  bundle: true,
38
38
  outfile: distMainFile,
39
39
  platform: 'node',
40
+ // https://esbuild.github.io/api/#main-fields
41
+ // 当 platform 是 node 时,
42
+ // esbuild 默认的 mainFields 是 main,module,
43
+ // 这会导致 treeShaking 失效
44
+ mainFields: ['module', 'main'],
40
45
  target: `node${process.version.slice(1)}`,
41
46
  external: external,
42
47
  minify: (_options$minify = options.minify) != null ? _options$minify : true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "1.11.2",
3
+ "version": "1.11.3",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",