Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Last active September 2, 2018 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/ee03ecf41521036cc46c6be1aca1b77c to your computer and use it in GitHub Desktop.
Save nolanlawson/ee03ecf41521036cc46c6be1aca1b77c to your computer and use it in GitHub Desktop.
Repro webpack-bundle-analyzer with workerize-loader

Repro:

npx webpack
{
"name": "repro-webpack-bundle-analyzer",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Nolan Lawson <nolan@nolanlawson.com>",
"license": "Apache-2.0",
"dependencies": {
"webpack": "^4.17.1",
"webpack-bundle-analyzer": "^2.13.1",
"workerize-loader": "^1.0.4"
},
"devDependencies": {
"webpack-cli": "^3.1.0"
}
}
var worker = require('./worker.js')()
worker.sayHello()
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
module: {
rules: [
{
test: /worker\.js$/,
use: [
'workerize-loader'
]
}
]
},
plugins: [
new BundleAnalyzerPlugin()
]
}
export function sayHello() {
console.log('hello world')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment