Add webpack

This commit is contained in:
Jerome Wu
2019-10-23 21:52:04 +08:00
parent 9ff7984c4c
commit 99adf5138c
8 changed files with 5395 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
const path = require('path');
const webpack = require('webpack');
const common = require('./webpack.config.common');
const genConfig = ({
entry, filename, library, libraryTarget,
}) => ({
...common,
mode: 'development',
entry,
output: {
filename,
library,
libraryTarget,
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
FFMPEG_ENV: JSON.stringify('development'),
},
}),
],
devServer: {
allowedHosts: ['localhost', '.gitpod.io'],
},
});
module.exports = [
genConfig({
entry: path.resolve(__dirname, '..', 'src', 'index.js'),
filename: 'ffmpeg.dev.js',
library: 'FFmpeg',
libraryTarget: 'umd',
}),
//genConfig({
// entry: path.resolve(__dirname, '..', 'src', 'worker-script', 'browser', 'index.js'),
// filename: 'worker.dev.js',
//}),
];