Public
Edited
Nov 18, 2021
1 fork
Importers
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bundled = bundle(uuidUrl)
Insert cell
Insert cell
uuidCode = bundled.code
Insert cell
uuid = eval(uuidCode)
Insert cell
uuid.v4()
Insert cell
Insert cell
workerCode = `
addEventListener("fetch", event => {
event.respondWith(new Response(uuid.v4()))
})

const uuid = ${uuidCode}
`
Insert cell
Insert cell
async function bundle(url) {
const warnings = [];
const rollupConfig = {
input: url,
plugins: [rollup_plugin_fetchUrl()],
onwarn(warning) {
warnings.push(warning);
},
output: {
format: "iife"
}
};

const bundle = await rollup(rollupConfig);
const generated = await bundle.generate(rollupConfig.output);
await bundle.close();

return { warnings, code: generated.output[0].code, ...generated };
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more