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') | |
} |