-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (46 loc) · 1022 Bytes
/
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
const path = require('path')
// Configurations shared between all builds
const common = {
mode: 'production',
entry: ['core-js/stable', 'regenerator-runtime/runtime', './src/index.ts'],
output: {
filename: 'solid-typeindex-parser.bundle.js',
library: 'SolidTypeIndexParser',
libraryExport: 'default'
},
module: {
rules: [{
test: /\.(js|jsx|tsx|ts)$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
},
resolve: {
extensions: ['*', '.js', '.jsx', '.tsx', '.ts']
},
devtool: 'source-map'
}
// Configurations specific to the browser build
const browser = {
...common,
name: 'browser',
output: {
...common.output,
path: path.resolve(__dirname, 'dist', 'browser'),
libraryTarget: 'umd'
}
}
// Configurations specific to the node build
const node = {
...common,
name: 'node',
output: {
...common.output,
path: path.resolve(__dirname, 'dist', 'node'),
libraryTarget: 'commonjs2'
}
}
module.exports = [
browser,
node
]