-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
55 lines (54 loc) · 1.21 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const path = require('path')
const dotenv = require('dotenv-webpack')
const html = require('html-webpack-plugin')
const favicon = require('favicons-webpack-plugin')
module.exports = {
entry: {
app: ['@babel/polyfill', path.resolve(__dirname, 'src', 'index.js')],
worker: 'ffmpeg.js/ffmpeg-worker-youtube.js',
},
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader'],
exclude: [/node_modules/, /\-worker\-.*?\.js$/],
},
{
test: /\-worker\-.*?\.js$/,
use: ['worker-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(jpe?g|png)?$/,
use: ['file-loader'],
},
{
test: /\.(eot|ttf|svg|woff2?)(\?v=\d+\.\d+\.\d+)?$/,
use: ['url-loader'],
}
],
},
// usefull for ffmpeg.js worker
node: {
fs: 'empty',
},
resolve: {
modules: [
path.join(__dirname, 'src'),
'node_modules',
],
},
plugins: [
new dotenv(),
new html({
template: path.join(__dirname, 'src', 'resources', 'index.html'),
}),
new favicon({
logo: path.join(__dirname, 'src', 'resources', 'favicon.png'),
}),
],
}