-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
webpack.config.js
59 lines (58 loc) · 1.15 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
import path from 'path'
const __dirname = path.resolve()
const config = {
mode: 'production',
entry: {
main: './index.js',
animation: './animation',
color: './color',
distort: './distort',
draw: './draw',
filter: './filter',
generative: './generative',
geometry: './geometry',
lighting: './lighting',
math: './math',
morphological: './morphological',
sample: './sample',
sdf: './sdf',
simulate: './simulate',
space: './space',
},
module: {
rules: [
{
test: /\.glsl$/,
use: {
loader: 'webpack-glsl-loader',
},
},
],
},
}
const targetModule = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'module/lygia.[name].js',
libraryTarget: 'module',
},
experiments: {
outputModule: true,
},
}
const targetUmd = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'umd/lygia.[name].js',
library: {
root: 'Lygia',
amd: 'lygia',
commonjs: 'lygia',
},
libraryTarget: 'umd',
},
}
export default [
Object.assign({}, config, targetUmd),
Object.assign({}, config, targetModule),
]