-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
62 lines (60 loc) · 1.67 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const Dotenv = require('dotenv-webpack');
module.exports = {
entry: './src/index.tsx',
output: {
path: path.join(__dirname, '/build'),
filename: 'main.js'
},
devServer: {
historyApiFallback: true,
port: 1000
},
module: {
rules: [
{
test: /.jsx?$/,
exclude: /node_modules/,
include: path.resolve(__dirname, 'src'),
loader: require.resolve("babel-loader"),
},
{
test: /.(ts|tsx)$/,
exclude: /node_modules/,
use: 'ts-loader',
},
{
test: /.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /.(png|jpg|jpeg|gif|svg|ico|webp)$/i,
type: 'asset/resource'
}
]
},
plugins: [
new Dotenv(),
new HtmlWebpackPlugin({
template: './public/index.html'
})
],
resolve: {
modules: [__dirname, "src", "node_modules"],
extensions: ['.tsx', '.ts', '.js', 'jsx'],
alias: {
'@': path.resolve(__dirname, 'src'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@components': path.resolve(__dirname, 'src/components'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@store': path.resolve(__dirname, 'src/store'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@helpers': path.resolve(__dirname, 'src/utils/helpers'),
'@constants': path.resolve(__dirname, 'src/utils/constants'),
'@services': path.resolve(__dirname, 'src/utils/services'),
'@modals': path.resolve(__dirname, 'src/components/Modal'),
}
},
}