-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathwebpack.config.js
45 lines (44 loc) · 1.11 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
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
fallback: {
util: require.resolve('util/'),
path: require.resolve('path-browserify'),
buffer: require.resolve('buffer/'),
os: require.resolve('os-browserify/browser'),
url: require.resolve('url/'),
stream: require.resolve('stream-browserify'),
https: require.resolve('https-browserify'),
assert: require.resolve('assert/'),
http: require.resolve('stream-http'),
fs: false,
events: require.resolve('events/'),
process: require.resolve('process/browser'),
},
},
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
library: '@spruceid/ssx',
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: 'this',
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
};