I have the following Deno code...
import rollup from "https://unpkg.com/rollup/dist/es/rollup.js";
const inputOptions = {
input: "./index.mjs"
}
const outputOptions = {
format: "esm",
sourcemap: "inline"
}
const build = async ()=>{
const bundle = await rollup.rollup(inputOptions);
const { output } = await bundle.generate(outputOptions);
for (const chunkOrAsset of output) {
if (chunkOrAsset.type === 'asset') {
console.log('Asset', chunkOrAsset);
} else{
console.log('Chunk', chunkOrAsset.modules);
}
}
}
But when I try to run I get...
error: relative import path "path" not prefixed with / or ./ or ../ Imported from "https://unpkg.com/rollup@2.26.11/dist/es/rollup.js"
I also tried
import rollup from "https://unpkg.com/rollup";
but I get...
error: Uncaught SyntaxError: The requested module 'https://unpkg.com/rollup' does not provide an export named 'default'
finally I tried...
import * as rollup from "https://unpkg.com/rollup";
But I get...
error: Uncaught ReferenceError: exports is not defined
Object.defineProperty(exports, '__esModule', { value: true });
How do I get rollup to work with Deno?