-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.prod.js
executable file
·51 lines (50 loc) · 1.66 KB
/
webpack.config.prod.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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const keysTransformer = require('ts-transformer-keys/transformer').default;
module.exports = {
entry: './src/index.tsx',
mode: 'production',
devtool: 'source-map',
module: {
rules: [
{
test: /\.(tsx|ts)?$/,
loader: 'ts-loader',
exclude: [/node_modules/, /tests/],
options: {
getCustomTransformers: program => ({
before: [
keysTransformer(program)
]
})
}
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
alias: {
'@components': path.resolve(__dirname, 'src/components/'),
'@pages': path.resolve(__dirname, 'src/pages/'),
'@api': path.resolve(__dirname, 'src/api/'),
'@utils': path.resolve(__dirname, 'src/utils/'),
'@hooks': path.resolve(__dirname, 'src/hooks/'),
'@constants': path.resolve(__dirname, 'src/constants'),
'@types': path.resolve(__dirname, 'src/types')
}
},
output: {
filename: 'bundle.[contenthash].js',
publicPath: '/',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve('./src/index.html')
})
]
};