forked from reef-defi/reef-app_moved
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
82 lines (76 loc) · 1.65 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
require('process');
module.exports = {
mode: 'development',
entry: path.join(__dirname, "src", "index.tsx"),
output: {
path:path.resolve(__dirname, "public"),
},
module: {
rules: [
{
test: /\.?js$/,
exclude: /node_modules/,
loader: "babel-loader",
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.(png|svg|jpe?g|gif)$/i,
loader: 'file-loader',
exclude: /node_modules/,
},
{
test: /\.m?js/,
type: "javascript/auto",
},
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /favicon\.ico$/,
loader: 'url-loader',
},
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.cjs'],
fallback: {
'crypto': require.resolve('crypto-browserify'),
'stream': require.resolve('stream-browserify'),
},
},
devServer: {
static: {
directory: path.join(__dirname, 'public'),
},
hot: true,
port: 3000,
historyApiFallback: true
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, "public", "index-template.html"),
favicon: path.join(__dirname, "public", "favicon.ico")
}),
new webpack.ProvidePlugin({
process: 'process/browser'
})
],
}