-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (34 loc) · 691 Bytes
/
webpack.config.js
File metadata and controls
35 lines (34 loc) · 691 Bytes
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
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: 'production',
entry: './src/index.ts',
target: 'web',
output: {
library: 'URlib',
libraryTarget: 'umd',
filename: 'urlib.min.js',
globalObject: 'this',
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'babel-loader',
},
],
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser',
}),
],
resolve: {
extensions: ['.ts', '.js', '.json'],
fallback: {
buffer: require.resolve('buffer/'),
stream: require.resolve('stream-browserify'),
},
},
};