rollup 4.0.0-8 → 4.0.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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.0.0-8
4
- Sun, 20 Aug 2023 11:21:28 GMT - commit 5bfa022de96252b5eaf0bdab90be6bcfefcccb57
3
+ Rollup.js v4.0.0
4
+ Thu, 05 Oct 2023 15:13:44 GMT - commit 2f261358c62b4f9e62cb86bf99de8d4ff3668994
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-8
4
- Sun, 20 Aug 2023 11:21:28 GMT - commit 5bfa022de96252b5eaf0bdab90be6bcfefcccb57
3
+ Rollup.js v4.0.0
4
+ Thu, 05 Oct 2023 15:13:44 GMT - commit 2f261358c62b4f9e62cb86bf99de8d4ff3668994
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-8
4
- Sun, 20 Aug 2023 11:21:28 GMT - commit 5bfa022de96252b5eaf0bdab90be6bcfefcccb57
3
+ Rollup.js v4.0.0
4
+ Thu, 05 Oct 2023 15:13:44 GMT - commit 2f261358c62b4f9e62cb86bf99de8d4ff3668994
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-8",
3
+ "version": "4.0.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -31,13 +31,15 @@
31
31
  }
32
32
  },
33
33
  "scripts": {
34
- "build": "npm run build:wasm && concurrently -c green,blue 'npm run build:napi -- --release' 'npm:build:js' && npm run build:copy-native",
34
+ "build": "npm run build:wasm && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
35
35
  "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",
36
+ "build:napi": "napi build --platform --dts native.d.ts --js native.js --cargo-cwd rust -p bindings_napi --cargo-name bindings_napi",
37
37
  "build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
38
38
  "build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
39
39
  "update:napi": "npm run build:napi && npm run build:copy-native",
40
40
  "build:js": "rollup --config rollup.config.ts --configPlugin typescript",
41
+ "build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode",
42
+ "build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native",
41
43
  "update:js": "npm run build:js && npm run build:copy-native",
42
44
  "build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/",
43
45
  "dev": "vitepress dev docs",
@@ -45,8 +47,7 @@
45
47
  "build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript && shx rm -rf dist-build",
46
48
  "build:docs": "vitepress build docs",
47
49
  "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",
50
+ "ci:artifacts": "napi artifacts",
50
51
  "ci:lint": "concurrently -c red,green,blue 'npm:lint:js:nofix' 'npm:lint:markdown:nofix' 'npm:lint:rust:nofix'",
51
52
  "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
53
  "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 +61,11 @@
60
61
  "lint:rust:nofix": "cd rust && cargo fmt --check",
61
62
  "perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
62
63
  "perf:init": "node scripts/perf-init.js",
63
- "prepare": "husky install && node scripts/check-release.js || npm run build",
64
+ "prepare": "husky install && node scripts/check-release.js || npm run build:prepare",
64
65
  "prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js",
66
+ "postpublish": "node scripts/postpublish.js",
65
67
  "prepublish:napi": "napi prepublish --skip-gh-release",
66
- "release": "node scripts/release.js",
68
+ "release": "node scripts/prepare-release.js",
67
69
  "release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
68
70
  "test": "npm run build && npm run test:all",
69
71
  "test:update-snapshots": "node scripts/update-snapshots.js",
@@ -96,62 +98,62 @@
96
98
  "homepage": "https://rollupjs.org/",
97
99
  "optionalDependencies": {
98
100
  "fsevents": "~2.3.2",
99
- "@rollup/rollup-darwin-arm64": "4.0.0-8",
100
- "@rollup/rollup-android-arm64": "4.0.0-8",
101
- "@rollup/rollup-win32-arm64-msvc": "4.0.0-8",
102
- "@rollup/rollup-linux-arm64-gnu": "4.0.0-8",
103
- "@rollup/rollup-android-arm-eabi": "4.0.0-8",
104
- "@rollup/rollup-linux-arm-gnueabihf": "4.0.0-8",
105
- "@rollup/rollup-win32-ia32-msvc": "4.0.0-8",
106
- "@rollup/rollup-darwin-x64": "4.0.0-8",
107
- "@rollup/rollup-win32-x64-msvc": "4.0.0-8",
108
- "@rollup/rollup-linux-x64-gnu": "4.0.0-8",
109
- "@rollup/rollup-linux-x64-musl": "4.0.0-8"
101
+ "@rollup/rollup-darwin-arm64": "4.0.0",
102
+ "@rollup/rollup-android-arm64": "4.0.0",
103
+ "@rollup/rollup-win32-arm64-msvc": "4.0.0",
104
+ "@rollup/rollup-linux-arm64-gnu": "4.0.0",
105
+ "@rollup/rollup-android-arm-eabi": "4.0.0",
106
+ "@rollup/rollup-linux-arm-gnueabihf": "4.0.0",
107
+ "@rollup/rollup-win32-ia32-msvc": "4.0.0",
108
+ "@rollup/rollup-darwin-x64": "4.0.0",
109
+ "@rollup/rollup-win32-x64-msvc": "4.0.0",
110
+ "@rollup/rollup-linux-x64-gnu": "4.0.0",
111
+ "@rollup/rollup-linux-x64-musl": "4.0.0"
112
+ },
113
+ "devDependenciesComments": {
114
+ "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps"
110
115
  },
111
116
  "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",
117
+ "@codemirror/commands": "^6.3.0",
118
+ "@codemirror/lang-javascript": "^6.2.1",
119
+ "@codemirror/language": "^6.9.1",
120
+ "@codemirror/search": "^6.5.4",
116
121
  "@codemirror/state": "^6.2.1",
117
- "@codemirror/view": "^6.16.0",
122
+ "@codemirror/view": "^6.21.2",
118
123
  "@jridgewell/sourcemap-codec": "^1.4.15",
119
- "@mermaid-js/mermaid-cli": "^10.3.0",
120
- "@napi-rs/cli": "^2.16.2",
124
+ "@mermaid-js/mermaid-cli": "^10.4.0",
125
+ "@napi-rs/cli": "^2.16.3",
121
126
  "@rollup/plugin-alias": "^5.0.0",
122
127
  "@rollup/plugin-buble": "^1.0.2",
123
- "@rollup/plugin-commonjs": "^25.0.3",
128
+ "@rollup/plugin-commonjs": "^25.0.4",
124
129
  "@rollup/plugin-json": "^6.0.0",
125
- "@rollup/plugin-node-resolve": "^15.1.0",
130
+ "@rollup/plugin-node-resolve": "^15.2.1",
126
131
  "@rollup/plugin-replace": "^5.0.2",
127
132
  "@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",
133
+ "@rollup/plugin-typescript": "11.1.4",
134
+ "@rollup/pluginutils": "^5.0.4",
135
+ "@types/estree": "1.0.2",
136
+ "@types/mocha": "^10.0.2",
137
+ "@types/node": "18.0.0",
138
+ "@types/yargs-parser": "^21.0.1",
139
+ "@typescript-eslint/eslint-plugin": "^6.7.4",
140
+ "@typescript-eslint/parser": "^6.7.4",
137
141
  "@vue/eslint-config-prettier": "^8.0.0",
138
- "@vue/eslint-config-typescript": "^11.0.3",
142
+ "@vue/eslint-config-typescript": "^12.0.0",
139
143
  "acorn": "^8.10.0",
140
144
  "acorn-import-assertions": "^1.9.0",
141
- "acorn-jsx": "^5.3.2",
142
- "acorn-walk": "^8.2.0",
143
145
  "buble": "^0.20.0",
144
146
  "builtin-modules": "^3.3.0",
145
147
  "chokidar": "^3.5.3",
146
148
  "colorette": "^2.0.20",
147
- "concurrently": "^8.2.0",
148
- "core-js": "^3.32.0",
149
+ "concurrently": "^8.2.1",
150
+ "core-js": "^3.33.0",
149
151
  "date-time": "^4.0.0",
150
152
  "es5-shim": "^4.6.7",
151
153
  "es6-shim": "^0.35.8",
152
- "eslint": "^8.46.0",
154
+ "eslint": "^8.50.0",
153
155
  "eslint-config-prettier": "^9.0.0",
154
- "eslint-plugin-import": "^2.28.0",
156
+ "eslint-plugin-import": "^2.28.1",
155
157
  "eslint-plugin-prettier": "^5.0.0",
156
158
  "eslint-plugin-unicorn": "^48.0.1",
157
159
  "eslint-plugin-vue": "^9.17.0",
@@ -161,20 +163,20 @@
161
163
  "github-api": "^3.4.0",
162
164
  "hash.js": "^1.1.7",
163
165
  "husky": "^8.0.3",
164
- "inquirer": "^9.2.10",
165
- "is-reference": "^3.0.1",
166
- "lint-staged": "^13.2.3",
166
+ "inquirer": "^9.2.11",
167
+ "is-reference": "^3.0.2",
168
+ "lint-staged": "^14.0.1",
167
169
  "locate-character": "^3.0.0",
168
- "magic-string": "^0.30.2",
170
+ "magic-string": "^0.30.4",
169
171
  "mocha": "^10.2.0",
170
172
  "nyc": "^15.1.0",
171
173
  "pinia": "^2.1.6",
172
- "prettier": "^3.0.1",
174
+ "prettier": "^3.0.3",
173
175
  "pretty-bytes": "^6.1.1",
174
176
  "pretty-ms": "^8.0.0",
175
177
  "requirejs": "^2.3.6",
176
- "rollup": "^3.28.0",
177
- "rollup-plugin-license": "^3.0.1",
178
+ "rollup": "^3.29.4",
179
+ "rollup-plugin-license": "^3.1.0",
178
180
  "rollup-plugin-string": "^3.0.0",
179
181
  "rollup-plugin-thatworks": "^1.0.4",
180
182
  "semver": "^7.5.4",
@@ -182,12 +184,12 @@
182
184
  "signal-exit": "^4.1.0",
183
185
  "source-map": "^0.7.4",
184
186
  "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",
187
+ "systemjs": "^6.14.2",
188
+ "terser": "^5.21.0",
189
+ "tslib": "^2.6.2",
190
+ "typescript": "^5.2.2",
191
+ "vite": "^4.4.11",
192
+ "vitepress": "^1.0.0-rc.20",
191
193
  "vue": "^3.3.4",
192
194
  "wasm-pack": "^0.12.1",
193
195
  "weak-napi": "^2.0.2",
@@ -197,7 +199,7 @@
197
199
  "semver": "^7.5.4"
198
200
  },
199
201
  "files": [
200
- "dist/**/*.cjs",
202
+ "dist/*.node",
201
203
  "dist/**/*.js",
202
204
  "dist/*.d.ts",
203
205
  "dist/bin/rollup",
@@ -223,6 +225,11 @@
223
225
  "require": "./dist/getLogFilter.js",
224
226
  "import": "./dist/es/getLogFilter.js"
225
227
  },
228
+ "./parseAst": {
229
+ "types": "./dist/parseAst.d.ts",
230
+ "require": "./dist/parseAst.js",
231
+ "import": "./dist/es/parseAst.js"
232
+ },
226
233
  "./dist/*": "./dist/*"
227
234
  }
228
235
  }
package/dist/native.cjs DELETED
@@ -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