-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (37 loc) · 986 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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
module.exports = {
entry: './index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
resolve: {
extensions: ['.ts', '.js'],
fallback: {
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
vm: require.resolve('vm-browserify'),
},
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.html',
inject: 'body',
}),
new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/bundle/]),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
optimization: {
minimize: false,
},
devtool: 'source-map',
};