Added web worker example

This commit is contained in:
Nathan Johnson
2022-05-17 16:50:23 -05:00
parent 09871cc01a
commit da317da7ef
7 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
const path = require('path');
const webpack = require('webpack');
const common = require('./webpack.config.common');
const genConfig = ({
entry, filename, library, libraryTarget,
}) => ({
...common,
mode: 'development',
target: 'webworker',
entry,
output: {
filename,
library,
libraryTarget,
},
devServer: {
allowedHosts: ['localhost', '.gitpod.io'],
},
});
module.exports = [
genConfig({
entry: path.resolve(__dirname, '..', 'src', 'index.js'),
filename: 'ffmpeg.dev.js',
library: 'FFmpeg',
libraryTarget: 'umd',
}),
];