-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (52 loc) · 1.23 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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: path.resolve(__dirname, 'src/index.tsx'),
output: {
path: path.resolve(__dirname, 'public'),
publicPath: '/',
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
'~': path.resolve('./src'),
},
},
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env.LOCAL_ENV': JSON.stringify(process.env.LOCAL_ENV),
'process.env.NETLIFY_SERVER': JSON.stringify(process.env.NETLIFY_SERVER),
'process.env.MY_PROFILE_CONTRACT_ADDRESS': JSON.stringify(
process.env.MY_PROFILE_CONTRACT_ADDRESS
),
}),
new HtmlWebpackPlugin({
template: './src/index.ejs',
templateParameters: {
LOCAL_ENV: process.env.LOCAL_ENV || false,
},
}),
],
devServer: {
hot: true,
port: 9212,
historyApiFallback: true,
static: {
directory: path.join(__dirname, 'public'),
},
},
};