Open
Description
It seems currently not possible to use this plugin with WMR:
yarn create wmr your-project-name
cd your-project-name
yarn add --dev @surma/rollup-plugin-off-main-thread
echo 'import OMT from "@surma/rollup-plugin-off-main-thread";' > wmr.config.mjs
echo 'export default async function (config) {' >> wmr.config.mjs
echo 'config.plugins.push(OMT());' >> wmr.config.mjs
echo '}' >> wmr.config.mjs
echo 'new Worker(new URL("./worker.js", import.meta.url), {type:"module"});' > public/pages/home/index.js
echo 'export default function Home() { return <div>Home</div>; }' >> public/pages/home/index.js
echo 'console.log("Worker working")' > public/pages/home/worker.js
yarn wmr build
This produces the following error:
`output.format` must either be "amd" or "esm", got "undefined"
I've tried to change the format in wmr.config.mjs
but didn't get much luck.
I can work around this by changing this line
rollup-plugin-off-main-thread/index.js
Line 204 in 0dc070b
if (format === "esm" || format === "es" || format === undefined) {
Is interoperability with WMR something on the roadmap?
Metadata
Metadata
Assignees
Labels
No labels