-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
79 lines (69 loc) · 1.49 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const ClosureCompilerPlugin = require('webpack-closure-compiler');
const path = require('path');
var BrowserTests = {
entry: [
path.join(__dirname, 'test', 'browser-tests.js')
],
output: {
path: path.join(__dirname, 'test'),
filename: 'browser-tests.build.js'
}
};
var OGVVideoDecoder = {
entry: [
path.join(__dirname, 'build-templates', 'OGVVideoDecoder.js')
],
output: {
path: path.join(__dirname, 'builds'),
filename: 'ogv-decoder-video-vp8.js'
},
plugins: [
new ClosureCompilerPlugin({
compiler: {
compilation_level: 'SIMPLE'
},
concurrency: 3,
})
]
};
var JsVpx = {
mode: 'production',
entry: [
path.join(__dirname, 'build-templates', 'jsvpx.js')
],
output: {
path: path.join(__dirname, 'builds'),
filename: 'jsvpx.js',
library: 'JsVpx',
libraryTarget: 'commonjs2',
},
plugins: [
new ClosureCompilerPlugin({
compiler: {
compilation_level: 'SIMPLE'
},
concurrency: 3,
})
]
};
var JsVpxBenchmark = {
entry: [
path.join(__dirname, 'benchmarks', 'benchmark.js')
],
output: {
path: path.join(__dirname, 'benchmarks'),
filename: 'benchmark.build.js'
},
module: {
noParse: [
path.resolve(__dirname, './node_modules/benchmark/benchmark.js'),
]
},
};
if (process.env) {
if (process.env.USE_BENCHMARK === "true") {
module.exports = [JsVpxBenchmark];
} else {
module.exports = [OGVVideoDecoder, JsVpx, BrowserTests];
}
}