-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.config.js
58 lines (54 loc) · 1.2 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
const path = require('path')
// Configurations shared between all builds
const common = {
mode: 'production',
entry: './src/index.js',
output: {
filename: 'solid-file-client.bundle.js',
library: 'SolidFileClient',
libraryExport: 'default',
},
externals: {
'solid-node-client': 'null',
'rdflib': {
commonjs: 'rdflib',
commonjs2: 'rdflib',
amd: 'rdflib',
root: '$rdf'
},
},
devtool: 'source-map',
}
// Configurations specific to the window build
const window = {
...common,
name: 'window',
output: {
...common.output,
path: path.resolve(__dirname, 'dist', 'window'),
libraryTarget: 'umd',
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
}
// Configurations specific to the node build
const node = {
...common,
name: 'node',
output: {
...common.output,
path: path.resolve(__dirname, 'dist', 'node'),
libraryTarget: 'commonjs2',
},
}
module.exports = [
window,
node,
]