@swc/core 1.2.125 → 1.2.126

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/binding.js +11 -5
  3. package/package.json +14 -14
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@
5
5
 
6
6
 
7
7
 
8
+ - **(es/minifier)** Fix comparison of objects, numbers and strings (#3172) ([db51ce4](https://github.com/swc-project/swc/commit/db51ce44614e3661c9c25c562d39b7581e521850))
9
+
10
+
11
+ - **(node-swc)** Recover from ldd not found ([1dfc2ee](https://github.com/swc-project/swc/commit/1dfc2ee1054d20b0d04699ebef3ab09b2f6fc4f8))
12
+
13
+ ### Features
14
+
15
+
16
+
17
+ - **(es/ast)** Add `ModuleExportName` (#3048) ([07c0489](https://github.com/swc-project/swc/commit/07c0489575188846b82b1af3e4bd711466e006ca))
18
+
19
+ ## [1.2.125] - 2022-01-02
20
+
21
+ ### Bug Fixes
22
+
23
+
24
+
8
25
  - **(es/compat)** Visit all private class methods (#3150) ([35b6461](https://github.com/swc-project/swc/commit/35b64613bb1f6de52d7362e66d28c50513dbbe12))
9
26
 
10
27
 
package/binding.js CHANGED
@@ -4,8 +4,16 @@ const { join } = require('path');
4
4
  const { platform, arch } = process;
5
5
  let nativeBinding = null;
6
6
  let localFileExisted = false;
7
- let isMusl = false;
8
7
  let loadError = null;
8
+ const isMusl = () => {
9
+ try {
10
+ const isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
11
+ return isMusl;
12
+ }
13
+ catch (e) {
14
+ return false;
15
+ }
16
+ };
9
17
  switch (platform) {
10
18
  case 'android':
11
19
  if (arch !== 'arm64') {
@@ -126,8 +134,7 @@ switch (platform) {
126
134
  case 'linux':
127
135
  switch (arch) {
128
136
  case 'x64':
129
- isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
130
- if (isMusl) {
137
+ if (isMusl()) {
131
138
  localFileExisted = existsSync(join(__dirname, 'swc.linux-x64-musl.node'));
132
139
  try {
133
140
  if (localFileExisted) {
@@ -157,8 +164,7 @@ switch (platform) {
157
164
  }
158
165
  break;
159
166
  case 'arm64':
160
- isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
161
- if (isMusl) {
167
+ if (isMusl()) {
162
168
  localFileExisted = existsSync(join(__dirname, 'swc.linux-arm64-musl.node'));
163
169
  try {
164
170
  if (localFileExisted) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.125",
3
+ "version": "1.2.126",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -51,19 +51,19 @@
51
51
  "@node-rs/helper": "^1.0.0"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@swc/core-win32-x64-msvc": "1.2.125",
55
- "@swc/core-darwin-x64": "1.2.125",
56
- "@swc/core-linux-x64-gnu": "1.2.125",
57
- "@swc/core-linux-x64-musl": "1.2.125",
58
- "@swc/core-freebsd-x64": "1.2.125",
59
- "@swc/core-win32-ia32-msvc": "1.2.125",
60
- "@swc/core-linux-arm64-gnu": "1.2.125",
61
- "@swc/core-linux-arm-gnueabihf": "1.2.125",
62
- "@swc/core-darwin-arm64": "1.2.125",
63
- "@swc/core-android-arm64": "1.2.125",
64
- "@swc/core-linux-arm64-musl": "1.2.125",
65
- "@swc/core-win32-arm64-msvc": "1.2.125",
66
- "@swc/core-android-arm-eabi": "1.2.125"
54
+ "@swc/core-win32-x64-msvc": "1.2.126",
55
+ "@swc/core-darwin-x64": "1.2.126",
56
+ "@swc/core-linux-x64-gnu": "1.2.126",
57
+ "@swc/core-linux-x64-musl": "1.2.126",
58
+ "@swc/core-freebsd-x64": "1.2.126",
59
+ "@swc/core-win32-ia32-msvc": "1.2.126",
60
+ "@swc/core-linux-arm64-gnu": "1.2.126",
61
+ "@swc/core-linux-arm-gnueabihf": "1.2.126",
62
+ "@swc/core-darwin-arm64": "1.2.126",
63
+ "@swc/core-android-arm64": "1.2.126",
64
+ "@swc/core-linux-arm64-musl": "1.2.126",
65
+ "@swc/core-win32-arm64-msvc": "1.2.126",
66
+ "@swc/core-android-arm-eabi": "1.2.126"
67
67
  },
68
68
  "types": "./index.d.ts",
69
69
  "scripts": {