webworkify-webpack2
v1.1.9
Published
launch a web worker that can require() in the browser with webpack, compatible with webworkify
Downloads
40
Maintainers
Readme
webworkify-webpack2
Launch a web worker that can require()
in the browser with webpack 2.
This fork of webworkify-webpack should only be used as an alias for original webworkify with webpack 2. It lets libraries that has webworkify dependency to be used with webpack 2 (e.g. videojs-contrib-hls).
how to use
First, replace webworkify
with webworkify-webpack2
by creating an alias in your webpack config:
resolve: {
alias: {
webworkify: 'webworkify-webpack2'
}
}
Then use the library you are trying to integrate as you would normally do:
import 'videojs-contrib-hls';
install
With npm do:
npm install webworkify-webpack2 --save
caveats
- While developing make sure not to set webpack's devtool option to be with some eval configuration because from 1.1.0 version it won't work - check #7
- When passing anonymous functions to webworkify-webpack2, naming them can prevent potential issues - #9, #10
license
MIT