Skip to content

Commit a67a02e

Browse files
committed
Added worker build script
1 parent 6a20902 commit a67a02e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"start": "node scripts/server.js",
1212
"start:worker": "node scripts/worker-server.js",
1313
"build": "rimraf dist && webpack --config scripts/webpack.config.prod.js",
14+
"build:worker": "rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",
1415
"prepublishOnly": "npm run build",
1516
"lint": "eslint src",
1617
"wait": "rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",

scripts/webpack.config.worker.prod.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const path = require('path');
2+
const common = require('./webpack.config.common');
3+
4+
const genConfig = ({
5+
entry, filename, library, libraryTarget,
6+
}) => ({
7+
...common,
8+
mode: 'production',
9+
devtool: 'source-map',
10+
target: 'webworker',
11+
entry,
12+
output: {
13+
path: path.resolve(__dirname, '..', 'dist'),
14+
filename,
15+
library,
16+
libraryTarget,
17+
},
18+
});
19+
20+
module.exports = [
21+
genConfig({
22+
entry: path.resolve(__dirname, '..', 'src', 'index.js'),
23+
filename: 'ffmpeg.min.js',
24+
library: 'FFmpeg',
25+
libraryTarget: 'umd',
26+
}),
27+
];

0 commit comments

Comments
 (0)