Added worker build script
This commit is contained in:
parent
da317da7ef
commit
694958ce81
@ -11,6 +11,7 @@
|
||||
"start": "node scripts/server.js",
|
||||
"start:worker": "node scripts/worker-server.js",
|
||||
"build": "rimraf dist && webpack --config scripts/webpack.config.prod.js",
|
||||
"build:worker": "rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",
|
||||
"prepublishOnly": "npm run build",
|
||||
"lint": "eslint src",
|
||||
"wait": "rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",
|
||||
|
27
scripts/webpack.config.worker.prod.js
Normal file
27
scripts/webpack.config.worker.prod.js
Normal file
@ -0,0 +1,27 @@
|
||||
const path = require('path');
|
||||
const common = require('./webpack.config.common');
|
||||
|
||||
const genConfig = ({
|
||||
entry, filename, library, libraryTarget,
|
||||
}) => ({
|
||||
...common,
|
||||
mode: 'production',
|
||||
devtool: 'source-map',
|
||||
target: 'webworker',
|
||||
entry,
|
||||
output: {
|
||||
path: path.resolve(__dirname, '..', 'dist'),
|
||||
filename,
|
||||
library,
|
||||
libraryTarget,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = [
|
||||
genConfig({
|
||||
entry: path.resolve(__dirname, '..', 'src', 'index.js'),
|
||||
filename: 'ffmpeg.min.js',
|
||||
library: 'FFmpeg',
|
||||
libraryTarget: 'umd',
|
||||
}),
|
||||
];
|
Loading…
Reference in New Issue
Block a user