@rollup/wasm-node
Advanced tools
Comparing version
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -15,14 +15,82 @@ https://github.com/rollup/rollup | ||
const rollup = require('./shared/rollup.js'); | ||
const watchProxy = require('./shared/watch-proxy.js'); | ||
require('./shared/parseAst.js'); | ||
require('./native.js'); | ||
require('node:path'); | ||
const parseAst_js = require('./shared/parseAst.js'); | ||
const fseventsImporter = require('./shared/fsevents-importer.js'); | ||
require('node:process'); | ||
require('tty'); | ||
require('node:path'); | ||
require('path'); | ||
require('node:perf_hooks'); | ||
require('./native.js'); | ||
require('node:fs/promises'); | ||
require('./shared/fsevents-importer.js'); | ||
class WatchEmitter { | ||
constructor() { | ||
this.currentHandlers = Object.create(null); | ||
this.persistentHandlers = Object.create(null); | ||
} | ||
// Will be overwritten by Rollup | ||
async close() { } | ||
emit(event, ...parameters) { | ||
return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters))); | ||
} | ||
off(event, listener) { | ||
const listeners = this.persistentHandlers[event]; | ||
if (listeners) { | ||
// A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1 | ||
// (which would remove the last array element if used unchanged) is turned | ||
// into max_int, which is outside the array and does not change anything. | ||
listeners.splice(listeners.indexOf(listener) >>> 0, 1); | ||
} | ||
return this; | ||
} | ||
on(event, listener) { | ||
this.getPersistentHandlers(event).push(listener); | ||
return this; | ||
} | ||
onCurrentRun(event, listener) { | ||
this.getCurrentHandlers(event).push(listener); | ||
return this; | ||
} | ||
once(event, listener) { | ||
const selfRemovingListener = (...parameters) => { | ||
this.off(event, selfRemovingListener); | ||
return listener(...parameters); | ||
}; | ||
this.on(event, selfRemovingListener); | ||
return this; | ||
} | ||
removeAllListeners() { | ||
this.removeListenersForCurrentRun(); | ||
this.persistentHandlers = Object.create(null); | ||
return this; | ||
} | ||
removeListenersForCurrentRun() { | ||
this.currentHandlers = Object.create(null); | ||
return this; | ||
} | ||
getCurrentHandlers(event) { | ||
return this.currentHandlers[event] || (this.currentHandlers[event] = []); | ||
} | ||
getPersistentHandlers(event) { | ||
return this.persistentHandlers[event] || (this.persistentHandlers[event] = []); | ||
} | ||
} | ||
function watch(configs) { | ||
const emitter = new WatchEmitter(); | ||
watchInternal(configs, emitter).catch(error => { | ||
rollup.handleError(error); | ||
}); | ||
return emitter; | ||
} | ||
async function watchInternal(configs, emitter) { | ||
const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true))); | ||
const watchOptionsList = optionsList.filter(config => config.watch !== false); | ||
if (watchOptionsList.length === 0) { | ||
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"')); | ||
} | ||
await fseventsImporter.loadFsEvents(); | ||
const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js')); | ||
new Watcher(watchOptionsList, emitter); | ||
} | ||
@@ -32,3 +100,3 @@ exports.VERSION = rollup.version; | ||
exports.rollup = rollup.rollup; | ||
exports.watch = watchProxy.watch; | ||
exports.watch = watch; | ||
//# sourceMappingURL=rollup.js.map |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -22,3 +22,3 @@ https://github.com/rollup/rollup | ||
const node_child_process = require('node:child_process'); | ||
const watchProxy = require('./watch-proxy.js'); | ||
const rollup_js = require('../rollup.js'); | ||
require('fs'); | ||
@@ -489,3 +489,3 @@ require('util'); | ||
async function start(configs, warnings) { | ||
watcher = watchProxy.watch(configs); | ||
watcher = rollup_js.watch(configs); | ||
watcher.on('event', event => { | ||
@@ -492,0 +492,0 @@ switch (event.code) { |
/* | ||
@license | ||
Rollup.js v4.7.0 | ||
Fri, 08 Dec 2023 07:57:30 GMT - commit 098e29ca3e0643006870f9ed94710fd3004a9043 | ||
Rollup.js v4.8.0 | ||
Mon, 11 Dec 2023 06:24:24 GMT - commit 62b648e1cc6a1f00260bb85aa2050097bb4afd2b | ||
@@ -6,0 +6,0 @@ https://github.com/rollup/rollup |
{ | ||
"name": "@rollup/wasm-node", | ||
"version": "4.7.0", | ||
"version": "4.8.0", | ||
"description": "Next-generation ES module bundler with Node wasm", | ||
@@ -5,0 +5,0 @@ "main": "dist/rollup.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3795360
0.06%53749
0.03%28
-3.45%