-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
34 lines (32 loc) · 959 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
34 lines (32 loc) · 959 Bytes
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
// const webpack = require('webpack');
const { CLIENT_PORT, SERVER_PORT } = require('./port_config');
require('dotenv').config();
module.exports = {
entry: `${__dirname}/client/app/components/index.tsx`,
output: {
path: `${__dirname}/client/public`,
filename: 'bundle.js',
},
devServer: {
static: {
directory: `${__dirname}/client/public`,
},
compress: true,
port: CLIENT_PORT,
proxy: [
{
context: ['/api'],
target: `http://localhost:${SERVER_PORT}`,
}
]
},
mode: 'development',
module: {
rules: [
{ test: /\.[jt]{1}sx?$/, use: 'babel-loader', exclude: /(node_modules)/ },
{ test: /\.css$/i, use: ['style-loader', 'css-loader'], exclude: /(node_modules)/ },
{ test: /\.s[ac]ss$/i, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /(node_modules)/ },
{ test: /\.(txt|jl)$/i, use: 'raw-loader', exclude: /(node_modules)/ },
],
},
};