-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
36 lines (35 loc) · 928 Bytes
/
webpack.common.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
/* eslint-disable */
const path = require('path');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const { EnvironmentPlugin } = require('webpack');
require('dotenv/config');
module.exports = {
entry: './src/index.tsx',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'@': path.resolve(__dirname, 'src/'),
},
},
module: {
rules: [
{
test: /\.(tsx|ts|js|jsx)$/,
use: ['babel-loader'],
exclude: /node_modules/,
},
{
test: /\.(png|svg|jpg|gif|mp4|webm|webp)$/,
type: 'asset',
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[chunkhash].js',
clean: true,
publicPath: '/',
},
plugins: [new ForkTsCheckerWebpackPlugin(), new EnvironmentPlugin(['REACT_APP_SERVER_URL'])],
};