Last active
July 15, 2017 20:41
-
-
Save Magellol/23b76a75d00d52c5a924b1311bd36358 to your computer and use it in GitHub Desktop.
Example of a webpack configuration to get workers code transpiled. Hint: "Rule.enforce".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
test: /\.js$/, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
// Babel loader options | |
}, | |
}, | |
], | |
}, | |
{ | |
test: /-worker\.js$/, | |
enforce: 'post', | |
use: [ | |
{ | |
loader: 'worker-loader', | |
options: { | |
// Worker loader options | |
}, | |
}, | |
], | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment