rollup 4.0.0-9 → 4.0.1

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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-9
4
- Sun, 20 Aug 2023 14:28:23 GMT - commit e4d55671a81334ddc59fdbcd81ceabdb77d96974
3
+ Rollup.js v4.0.1
4
+ Fri, 06 Oct 2023 12:35:45 GMT - commit fcab1f610fefb24621ce001dfb0831dd30e59ab3
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,6 +16,7 @@ const process$2 = require('node:process');
16
16
  const index = require('./index.js');
17
17
  const cli = require('../bin/rollup');
18
18
  const rollup = require('./rollup.js');
19
+ const parseAst_js = require('./parseAst.js');
19
20
  const loadConfigFile_js = require('./loadConfigFile.js');
20
21
  const node_child_process = require('node:child_process');
21
22
  const watchProxy = require('./watch-proxy.js');
@@ -29,8 +30,7 @@ require('events');
29
30
  require('node:path');
30
31
  require('tty');
31
32
  require('node:perf_hooks');
32
- require('node:crypto');
33
- require('../native.cjs');
33
+ require('../native.js');
34
34
  require('node:url');
35
35
  require('../getLogFilter.js');
36
36
 
@@ -512,7 +512,7 @@ async function watch(command) {
512
512
  ? input.join(', ')
513
513
  : Object.values(input).join(', ');
514
514
  }
515
- rollup.stderr(rollup.cyan$1(`bundles ${rollup.bold(input)} → ${rollup.bold(event.output.map(rollup.relativeId).join(', '))}...`));
515
+ rollup.stderr(rollup.cyan$1(`bundles ${rollup.bold(input)} → ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))}...`));
516
516
  }
517
517
  runWatchHook('onBundleStart');
518
518
  break;
@@ -520,7 +520,7 @@ async function watch(command) {
520
520
  case 'BUNDLE_END': {
521
521
  warnings.flush();
522
522
  if (!silent)
523
- rollup.stderr(rollup.green(`created ${rollup.bold(event.output.map(rollup.relativeId).join(', '))} in ${rollup.bold(cli.prettyMilliseconds(event.duration))}`));
523
+ rollup.stderr(rollup.green(`created ${rollup.bold(event.output.map(parseAst_js.relativeId).join(', '))} in ${rollup.bold(cli.prettyMilliseconds(event.duration))}`));
524
524
  runWatchHook('onBundleEnd');
525
525
  if (event.result && event.result.getTimings) {
526
526
  cli.printTimings(event.result.getTimings());
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-9
4
- Sun, 20 Aug 2023 14:28:23 GMT - commit e4d55671a81334ddc59fdbcd81ceabdb77d96974
3
+ Rollup.js v4.0.1
4
+ Fri, 06 Oct 2023 12:35:45 GMT - commit fcab1f610fefb24621ce001dfb0831dd30e59ab3
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -10,6 +10,7 @@
10
10
  'use strict';
11
11
 
12
12
  const rollup = require('./rollup.js');
13
+ const parseAst_js = require('./parseAst.js');
13
14
  const fseventsImporter = require('./fsevents-importer.js');
14
15
 
15
16
  class WatchEmitter {
@@ -76,7 +77,7 @@ async function watchInternal(configs, emitter) {
76
77
  const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
77
78
  const watchOptionsList = optionsList.filter(config => config.watch !== false);
78
79
  if (watchOptionsList.length === 0) {
79
- return rollup.error(rollup.logInvalidOption('watch', rollup.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
80
+ return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
80
81
  }
81
82
  await fseventsImporter.loadFsEvents();
82
83
  const { Watcher } = await Promise.resolve().then(() => require('./watch.js'));
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-9
4
- Sun, 20 Aug 2023 14:28:23 GMT - commit e4d55671a81334ddc59fdbcd81ceabdb77d96974
3
+ Rollup.js v4.0.1
4
+ Fri, 06 Oct 2023 12:35:45 GMT - commit fcab1f610fefb24621ce001dfb0831dd30e59ab3
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,11 +16,11 @@ const process = require('node:process');
16
16
  const rollup = require('./rollup.js');
17
17
  const node_os = require('node:os');
18
18
  const index = require('./index.js');
19
+ require('./parseAst.js');
20
+ require('../native.js');
19
21
  require('tty');
20
22
  require('path');
21
23
  require('node:perf_hooks');
22
- require('node:crypto');
23
- require('../native.cjs');
24
24
  require('node:fs/promises');
25
25
  require('fs');
26
26
  require('util');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "4.0.0-9",
3
+ "version": "4.0.1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -20,6 +20,7 @@
20
20
  "aarch64-linux-android",
21
21
  "aarch64-pc-windows-msvc",
22
22
  "aarch64-unknown-linux-gnu",
23
+ "aarch64-unknown-linux-musl",
23
24
  "armv7-linux-androideabi",
24
25
  "armv7-unknown-linux-gnueabihf",
25
26
  "i686-pc-windows-msvc",
@@ -31,13 +32,15 @@
31
32
  }
32
33
  },
33
34
  "scripts": {
34
- "build": "npm run build:wasm && concurrently -c green,blue 'npm run build:napi -- --release' 'npm:build:js' && npm run build:copy-native",
35
+ "build": "npm run build:wasm && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
35
36
  "build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
36
- "build:napi": "napi build --platform --dts native.d.ts --js native.cjs --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi",
37
+ "build:napi": "napi build --platform --dts native.d.ts --js false --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi",
37
38
  "build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
38
39
  "build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
39
40
  "update:napi": "npm run build:napi && npm run build:copy-native",
40
41
  "build:js": "rollup --config rollup.config.ts --configPlugin typescript",
42
+ "build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode",
43
+ "build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native",
41
44
  "update:js": "npm run build:js && npm run build:copy-native",
42
45
  "build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/",
43
46
  "dev": "vitepress dev docs",
@@ -45,8 +48,7 @@
45
48
  "build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript && shx rm -rf dist-build",
46
49
  "build:docs": "vitepress build docs",
47
50
  "preview:docs": "vitepress preview docs",
48
- "ci:copy-wasm-node": "node scripts/copy-wasm-node.js",
49
- "ci:artifacts": "npm run ci:copy-wasm-node && napi artifacts",
51
+ "ci:artifacts": "napi artifacts",
50
52
  "ci:lint": "concurrently -c red,green,blue 'npm:lint:js:nofix' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'",
51
53
  "ci:test:only": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && npm run test:only",
52
54
  "ci:test:all": "npm run build:cjs && npm run build:copy-native && npm run build:bootstrap && npm run build:copy-native && concurrently --kill-others-on-fail -c green,blue,magenta,cyan 'npm:test:only' 'npm:test:typescript' 'npm:test:leak' 'npm:test:browser'",
@@ -60,10 +62,11 @@
60
62
  "lint:rust:nofix": "cd rust && cargo fmt --check",
61
63
  "perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
62
64
  "perf:init": "node scripts/perf-init.js",
63
- "prepare": "husky install && node scripts/check-release.js || npm run build",
65
+ "prepare": "husky install && node scripts/check-release.js || npm run build:prepare",
64
66
  "prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js",
67
+ "postpublish": "node scripts/postpublish.js",
65
68
  "prepublish:napi": "napi prepublish --skip-gh-release",
66
- "release": "node scripts/release.js",
69
+ "release": "node scripts/prepare-release.js",
67
70
  "release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
68
71
  "test": "npm run build && npm run test:all",
69
72
  "test:update-snapshots": "node scripts/update-snapshots.js",
@@ -96,62 +99,63 @@
96
99
  "homepage": "https://rollupjs.org/",
97
100
  "optionalDependencies": {
98
101
  "fsevents": "~2.3.2",
99
- "@rollup/rollup-darwin-arm64": "4.0.0-9",
100
- "@rollup/rollup-android-arm64": "4.0.0-9",
101
- "@rollup/rollup-win32-arm64-msvc": "4.0.0-9",
102
- "@rollup/rollup-linux-arm64-gnu": "4.0.0-9",
103
- "@rollup/rollup-android-arm-eabi": "4.0.0-9",
104
- "@rollup/rollup-linux-arm-gnueabihf": "4.0.0-9",
105
- "@rollup/rollup-win32-ia32-msvc": "4.0.0-9",
106
- "@rollup/rollup-darwin-x64": "4.0.0-9",
107
- "@rollup/rollup-win32-x64-msvc": "4.0.0-9",
108
- "@rollup/rollup-linux-x64-gnu": "4.0.0-9",
109
- "@rollup/rollup-linux-x64-musl": "4.0.0-9"
102
+ "@rollup/rollup-darwin-arm64": "4.0.1",
103
+ "@rollup/rollup-android-arm64": "4.0.1",
104
+ "@rollup/rollup-win32-arm64-msvc": "4.0.1",
105
+ "@rollup/rollup-linux-arm64-gnu": "4.0.1",
106
+ "@rollup/rollup-linux-arm64-musl": "4.0.1",
107
+ "@rollup/rollup-android-arm-eabi": "4.0.1",
108
+ "@rollup/rollup-linux-arm-gnueabihf": "4.0.1",
109
+ "@rollup/rollup-win32-ia32-msvc": "4.0.1",
110
+ "@rollup/rollup-darwin-x64": "4.0.1",
111
+ "@rollup/rollup-win32-x64-msvc": "4.0.1",
112
+ "@rollup/rollup-linux-x64-gnu": "4.0.1",
113
+ "@rollup/rollup-linux-x64-musl": "4.0.1"
114
+ },
115
+ "devDependenciesComments": {
116
+ "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps"
110
117
  },
111
118
  "devDependencies": {
112
- "@codemirror/commands": "^6.2.4",
113
- "@codemirror/lang-javascript": "^6.1.9",
114
- "@codemirror/language": "^6.8.0",
115
- "@codemirror/search": "^6.5.1",
119
+ "@codemirror/commands": "^6.3.0",
120
+ "@codemirror/lang-javascript": "^6.2.1",
121
+ "@codemirror/language": "^6.9.1",
122
+ "@codemirror/search": "^6.5.4",
116
123
  "@codemirror/state": "^6.2.1",
117
- "@codemirror/view": "^6.16.0",
124
+ "@codemirror/view": "^6.21.2",
118
125
  "@jridgewell/sourcemap-codec": "^1.4.15",
119
- "@mermaid-js/mermaid-cli": "^10.3.0",
120
- "@napi-rs/cli": "^2.16.2",
126
+ "@mermaid-js/mermaid-cli": "^10.4.0",
127
+ "@napi-rs/cli": "^2.16.3",
121
128
  "@rollup/plugin-alias": "^5.0.0",
122
129
  "@rollup/plugin-buble": "^1.0.2",
123
- "@rollup/plugin-commonjs": "^25.0.3",
130
+ "@rollup/plugin-commonjs": "^25.0.4",
124
131
  "@rollup/plugin-json": "^6.0.0",
125
- "@rollup/plugin-node-resolve": "^15.1.0",
132
+ "@rollup/plugin-node-resolve": "^15.2.1",
126
133
  "@rollup/plugin-replace": "^5.0.2",
127
134
  "@rollup/plugin-terser": "^0.4.3",
128
- "@rollup/plugin-typescript": "^11.1.2",
129
- "@rollup/plugin-wasm": "^6.1.3",
130
- "@rollup/pluginutils": "^5.0.2",
131
- "@types/estree": "1.0.1",
132
- "@types/mocha": "^10.0.1",
133
- "@types/node": "~18.17.5",
134
- "@types/yargs-parser": "^21.0.0",
135
- "@typescript-eslint/eslint-plugin": "^6.3.0",
136
- "@typescript-eslint/parser": "^6.3.0",
135
+ "@rollup/plugin-typescript": "11.1.4",
136
+ "@rollup/pluginutils": "^5.0.4",
137
+ "@types/estree": "1.0.2",
138
+ "@types/mocha": "^10.0.2",
139
+ "@types/node": "18.0.0",
140
+ "@types/yargs-parser": "^21.0.1",
141
+ "@typescript-eslint/eslint-plugin": "^6.7.4",
142
+ "@typescript-eslint/parser": "^6.7.4",
137
143
  "@vue/eslint-config-prettier": "^8.0.0",
138
- "@vue/eslint-config-typescript": "^11.0.3",
144
+ "@vue/eslint-config-typescript": "^12.0.0",
139
145
  "acorn": "^8.10.0",
140
146
  "acorn-import-assertions": "^1.9.0",
141
- "acorn-jsx": "^5.3.2",
142
- "acorn-walk": "^8.2.0",
143
147
  "buble": "^0.20.0",
144
148
  "builtin-modules": "^3.3.0",
145
149
  "chokidar": "^3.5.3",
146
150
  "colorette": "^2.0.20",
147
- "concurrently": "^8.2.0",
148
- "core-js": "^3.32.0",
151
+ "concurrently": "^8.2.1",
152
+ "core-js": "^3.33.0",
149
153
  "date-time": "^4.0.0",
150
154
  "es5-shim": "^4.6.7",
151
155
  "es6-shim": "^0.35.8",
152
- "eslint": "^8.46.0",
156
+ "eslint": "^8.50.0",
153
157
  "eslint-config-prettier": "^9.0.0",
154
- "eslint-plugin-import": "^2.28.0",
158
+ "eslint-plugin-import": "^2.28.1",
155
159
  "eslint-plugin-prettier": "^5.0.0",
156
160
  "eslint-plugin-unicorn": "^48.0.1",
157
161
  "eslint-plugin-vue": "^9.17.0",
@@ -161,20 +165,20 @@
161
165
  "github-api": "^3.4.0",
162
166
  "hash.js": "^1.1.7",
163
167
  "husky": "^8.0.3",
164
- "inquirer": "^9.2.10",
165
- "is-reference": "^3.0.1",
166
- "lint-staged": "^13.2.3",
168
+ "inquirer": "^9.2.11",
169
+ "is-reference": "^3.0.2",
170
+ "lint-staged": "^14.0.1",
167
171
  "locate-character": "^3.0.0",
168
- "magic-string": "^0.30.2",
172
+ "magic-string": "^0.30.4",
169
173
  "mocha": "^10.2.0",
170
174
  "nyc": "^15.1.0",
171
175
  "pinia": "^2.1.6",
172
- "prettier": "^3.0.1",
176
+ "prettier": "^3.0.3",
173
177
  "pretty-bytes": "^6.1.1",
174
178
  "pretty-ms": "^8.0.0",
175
179
  "requirejs": "^2.3.6",
176
- "rollup": "^3.28.0",
177
- "rollup-plugin-license": "^3.0.1",
180
+ "rollup": "^3.29.4",
181
+ "rollup-plugin-license": "^3.1.0",
178
182
  "rollup-plugin-string": "^3.0.0",
179
183
  "rollup-plugin-thatworks": "^1.0.4",
180
184
  "semver": "^7.5.4",
@@ -182,12 +186,12 @@
182
186
  "signal-exit": "^4.1.0",
183
187
  "source-map": "^0.7.4",
184
188
  "source-map-support": "^0.5.21",
185
- "systemjs": "^6.14.1",
186
- "terser": "^5.19.2",
187
- "tslib": "^2.6.1",
188
- "typescript": "^5.1.6",
189
- "vite": "^4.4.9",
190
- "vitepress": "^1.0.0-beta.7",
189
+ "systemjs": "^6.14.2",
190
+ "terser": "^5.21.0",
191
+ "tslib": "^2.6.2",
192
+ "typescript": "^5.2.2",
193
+ "vite": "^4.4.11",
194
+ "vitepress": "^1.0.0-rc.20",
191
195
  "vue": "^3.3.4",
192
196
  "wasm-pack": "^0.12.1",
193
197
  "weak-napi": "^2.0.2",
@@ -197,7 +201,7 @@
197
201
  "semver": "^7.5.4"
198
202
  },
199
203
  "files": [
200
- "dist/**/*.cjs",
204
+ "dist/*.node",
201
205
  "dist/**/*.js",
202
206
  "dist/*.d.ts",
203
207
  "dist/bin/rollup",
@@ -223,6 +227,11 @@
223
227
  "require": "./dist/getLogFilter.js",
224
228
  "import": "./dist/es/getLogFilter.js"
225
229
  },
230
+ "./parseAst": {
231
+ "types": "./dist/parseAst.d.ts",
232
+ "require": "./dist/parseAst.js",
233
+ "import": "./dist/es/parseAst.js"
234
+ },
226
235
  "./dist/*": "./dist/*"
227
236
  }
228
237
  }
@@ -1,257 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /* prettier-ignore */
4
-
5
- /* auto-generated by NAPI-RS */
6
-
7
- const { existsSync, readFileSync } = require('fs')
8
- const { join } = require('path')
9
-
10
- const { platform, arch } = process
11
-
12
- let nativeBinding = null
13
- let localFileExisted = false
14
- let loadError = null
15
-
16
- function isMusl() {
17
- // For Node 10
18
- if (!process.report || typeof process.report.getReport !== 'function') {
19
- try {
20
- const lddPath = require('child_process').execSync('which ldd').toString().trim()
21
- return readFileSync(lddPath, 'utf8').includes('musl')
22
- } catch (e) {
23
- return true
24
- }
25
- } else {
26
- const { glibcVersionRuntime } = process.report.getReport().header
27
- return !glibcVersionRuntime
28
- }
29
- }
30
-
31
- switch (platform) {
32
- case 'android':
33
- switch (arch) {
34
- case 'arm64':
35
- localFileExisted = existsSync(join(__dirname, 'rollup.android-arm64.node'))
36
- try {
37
- if (localFileExisted) {
38
- nativeBinding = require('./rollup.android-arm64.node')
39
- } else {
40
- nativeBinding = require('@rollup/rollup-android-arm64')
41
- }
42
- } catch (e) {
43
- loadError = e
44
- }
45
- break
46
- case 'arm':
47
- localFileExisted = existsSync(join(__dirname, 'rollup.android-arm-eabi.node'))
48
- try {
49
- if (localFileExisted) {
50
- nativeBinding = require('./rollup.android-arm-eabi.node')
51
- } else {
52
- nativeBinding = require('@rollup/rollup-android-arm-eabi')
53
- }
54
- } catch (e) {
55
- loadError = e
56
- }
57
- break
58
- default:
59
- throw new Error(`Unsupported architecture on Android ${arch}`)
60
- }
61
- break
62
- case 'win32':
63
- switch (arch) {
64
- case 'x64':
65
- localFileExisted = existsSync(
66
- join(__dirname, 'rollup.win32-x64-msvc.node')
67
- )
68
- try {
69
- if (localFileExisted) {
70
- nativeBinding = require('./rollup.win32-x64-msvc.node')
71
- } else {
72
- nativeBinding = require('@rollup/rollup-win32-x64-msvc')
73
- }
74
- } catch (e) {
75
- loadError = e
76
- }
77
- break
78
- case 'ia32':
79
- localFileExisted = existsSync(
80
- join(__dirname, 'rollup.win32-ia32-msvc.node')
81
- )
82
- try {
83
- if (localFileExisted) {
84
- nativeBinding = require('./rollup.win32-ia32-msvc.node')
85
- } else {
86
- nativeBinding = require('@rollup/rollup-win32-ia32-msvc')
87
- }
88
- } catch (e) {
89
- loadError = e
90
- }
91
- break
92
- case 'arm64':
93
- localFileExisted = existsSync(
94
- join(__dirname, 'rollup.win32-arm64-msvc.node')
95
- )
96
- try {
97
- if (localFileExisted) {
98
- nativeBinding = require('./rollup.win32-arm64-msvc.node')
99
- } else {
100
- nativeBinding = require('@rollup/rollup-win32-arm64-msvc')
101
- }
102
- } catch (e) {
103
- loadError = e
104
- }
105
- break
106
- default:
107
- throw new Error(`Unsupported architecture on Windows: ${arch}`)
108
- }
109
- break
110
- case 'darwin':
111
- localFileExisted = existsSync(join(__dirname, 'rollup.darwin-universal.node'))
112
- try {
113
- if (localFileExisted) {
114
- nativeBinding = require('./rollup.darwin-universal.node')
115
- } else {
116
- nativeBinding = require('@rollup/rollup-darwin-universal')
117
- }
118
- break
119
- } catch {}
120
- switch (arch) {
121
- case 'x64':
122
- localFileExisted = existsSync(join(__dirname, 'rollup.darwin-x64.node'))
123
- try {
124
- if (localFileExisted) {
125
- nativeBinding = require('./rollup.darwin-x64.node')
126
- } else {
127
- nativeBinding = require('@rollup/rollup-darwin-x64')
128
- }
129
- } catch (e) {
130
- loadError = e
131
- }
132
- break
133
- case 'arm64':
134
- localFileExisted = existsSync(
135
- join(__dirname, 'rollup.darwin-arm64.node')
136
- )
137
- try {
138
- if (localFileExisted) {
139
- nativeBinding = require('./rollup.darwin-arm64.node')
140
- } else {
141
- nativeBinding = require('@rollup/rollup-darwin-arm64')
142
- }
143
- } catch (e) {
144
- loadError = e
145
- }
146
- break
147
- default:
148
- throw new Error(`Unsupported architecture on macOS: ${arch}`)
149
- }
150
- break
151
- case 'freebsd':
152
- if (arch !== 'x64') {
153
- throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
154
- }
155
- localFileExisted = existsSync(join(__dirname, 'rollup.freebsd-x64.node'))
156
- try {
157
- if (localFileExisted) {
158
- nativeBinding = require('./rollup.freebsd-x64.node')
159
- } else {
160
- nativeBinding = require('@rollup/rollup-freebsd-x64')
161
- }
162
- } catch (e) {
163
- loadError = e
164
- }
165
- break
166
- case 'linux':
167
- switch (arch) {
168
- case 'x64':
169
- if (isMusl()) {
170
- localFileExisted = existsSync(
171
- join(__dirname, 'rollup.linux-x64-musl.node')
172
- )
173
- try {
174
- if (localFileExisted) {
175
- nativeBinding = require('./rollup.linux-x64-musl.node')
176
- } else {
177
- nativeBinding = require('@rollup/rollup-linux-x64-musl')
178
- }
179
- } catch (e) {
180
- loadError = e
181
- }
182
- } else {
183
- localFileExisted = existsSync(
184
- join(__dirname, 'rollup.linux-x64-gnu.node')
185
- )
186
- try {
187
- if (localFileExisted) {
188
- nativeBinding = require('./rollup.linux-x64-gnu.node')
189
- } else {
190
- nativeBinding = require('@rollup/rollup-linux-x64-gnu')
191
- }
192
- } catch (e) {
193
- loadError = e
194
- }
195
- }
196
- break
197
- case 'arm64':
198
- if (isMusl()) {
199
- localFileExisted = existsSync(
200
- join(__dirname, 'rollup.linux-arm64-musl.node')
201
- )
202
- try {
203
- if (localFileExisted) {
204
- nativeBinding = require('./rollup.linux-arm64-musl.node')
205
- } else {
206
- nativeBinding = require('@rollup/rollup-linux-arm64-musl')
207
- }
208
- } catch (e) {
209
- loadError = e
210
- }
211
- } else {
212
- localFileExisted = existsSync(
213
- join(__dirname, 'rollup.linux-arm64-gnu.node')
214
- )
215
- try {
216
- if (localFileExisted) {
217
- nativeBinding = require('./rollup.linux-arm64-gnu.node')
218
- } else {
219
- nativeBinding = require('@rollup/rollup-linux-arm64-gnu')
220
- }
221
- } catch (e) {
222
- loadError = e
223
- }
224
- }
225
- break
226
- case 'arm':
227
- localFileExisted = existsSync(
228
- join(__dirname, 'rollup.linux-arm-gnueabihf.node')
229
- )
230
- try {
231
- if (localFileExisted) {
232
- nativeBinding = require('./rollup.linux-arm-gnueabihf.node')
233
- } else {
234
- nativeBinding = require('@rollup/rollup-linux-arm-gnueabihf')
235
- }
236
- } catch (e) {
237
- loadError = e
238
- }
239
- break
240
- default:
241
- throw new Error(`Unsupported architecture on Linux: ${arch}`)
242
- }
243
- break
244
- default:
245
- throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
246
- }
247
-
248
- if (!nativeBinding) {
249
- if (loadError) {
250
- throw loadError
251
- }
252
- throw new Error(`Failed to load native binding`)
253
- }
254
-
255
- const { parse } = nativeBinding
256
-
257
- module.exports.parse = parse