-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
59 lines (56 loc) · 1.42 KB
/
webpack.common.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
const glob = require('glob');
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
// Get all valid channels
const CHANNELS = glob.sync("channels/**/boot.js").map(path => path.split('/')[1])
const _entries = {};
CHANNELS.forEach(function(c) {
_entries[c] = './channels/' + c + '/boot.js';
});
console.log('ENTRIES', _entries);
module.exports = {
entry: _entries,
plugins: [
new CopyPlugin({
patterns: [
'index.html',
'common.css',
'main.js',
'assets/**/*',
'channels/**/*.html',
],
}),
],
output: {
path: path.join(__dirname, '/build'),
filename: './channels/[name]/[name].bundle.js'
},
resolve: {
alias: {
'pumper': __dirname + '/libs/pumper'
},
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.(glsl|vs|fs|vert|frag)$/,
exclude: /node_modules/,
use: [
'raw-loader',
'glslify-loader'
]
},
{
test: /\.(js|ts)$/,
use: 'babel-loader',
exclude: /node_modules/,
},
]
},
performance: {
hints: false,
maxEntrypointSize: 1024000,
maxAssetSize: 1024000
},
};