Skip to content

Instantly share code, notes, and snippets.

@adamjmcgrath
Last active April 24, 2020 15:11
Show Gist options
  • Save adamjmcgrath/f697de44cf7b5056ac108edcc9815bff to your computer and use it in GitHub Desktop.
Save adamjmcgrath/f697de44cf7b5056ac108edcc9815bff to your computer and use it in GitHub Desktop.
rollup plugin bug

run npm start

...
ReferenceError: Blob is not defined
...
import Worker from 'web-worker:./webworker.js';
export default () => {
return new Worker();
}
{
"name": "tmp-rollup-webpack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "rollup -c && webpack rolled-up.js && node dist/main.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"rollup": "^2.7.2",
"rollup-plugin-web-worker-loader": "^0.9.1",
"webpack": "^4.43.0"
},
"devDependencies": {
"webpack-cli": "^3.3.11"
}
}
import webWorkerLoader from 'rollup-plugin-web-worker-loader';
export default {
input: 'index.js',
output: [
{
file: 'rolled-up.js',
format: 'commonjs',
},
],
plugins: [
webWorkerLoader()
],
}
module.exports = {
mode: 'development',
target: 'node',
devtool: false,
};
console.log('foo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment