-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.45 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
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './src/index.ts',
plugins: [
// janus.js does not use 'import' to access to the functionality of webrtc-adapter,
// instead it expects a global object called 'adapter' for that.
// Let's make that object available.
new webpack.ProvidePlugin({
adapter: ['webrtc-adapter', 'default']
})
],
module: {
rules: [
// janus.js does not use 'export' to provide its functionality to others, instead
// it creates a global variable called 'Janus' and expects consumers to use it.
// Let's use 'exports-loader' to simulate it uses 'export'.
{
test: require.resolve('janus-gateway-mirror'),
loader: 'exports-loader',
options: {
exports: 'Janus',
},
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
}
]
},
resolve: {
extensions: ['.txs', '.ts', '.js']
},
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd',
library: 'JanusFtlPlayer',
umdNamedDefine: true
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: false,
port: 9000
}
};