-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
56 lines (50 loc) · 1.6 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 LIBRARY_NAME = 'EkoPlayer';
const path = require('path');
const express = require('express');
module.exports = () => {
return {
mode: 'development', // Overridden in webpack.prod.js
entry: {
[LIBRARY_NAME]: path.join(__dirname, 'src', `${LIBRARY_NAME}.js`)
},
devServer: {
contentBase: './dist',
host: '0.0.0.0',
port: 9090,
before(app) {
app.use('/test/integration/public/',
express.static(path.join(__dirname, 'test', 'integration', 'public')));
},
open: true,
openPage: 'test/integration/public/index.html'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js', // Overridden in webpack.prod.js
library: LIBRARY_NAME,
libraryExport: 'default',
libraryTarget: 'umd',
globalObject: 'this',
},
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/
},
{
test: /(\.jsx|\.js)$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
]
},
resolve: {
modules: [path.resolve('./node_modules'), path.resolve('./src')],
extensions: ['.json', '.js']
},
// Static files
context: path.join(__dirname, 'src')
};
};