This repository was archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
66 lines (62 loc) · 1.44 KB
/
Copy pathwebpack.dev.config.js
File metadata and controls
66 lines (62 loc) · 1.44 KB
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
63
64
65
66
// Generated using webpack-cli https://github.com/webpack/webpack-cli
const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const Dotenv = require('dotenv-webpack');
const webpack = require('webpack');
module.exports = {
mode: 'development',
resolve: {
fallback: {
'https': false,
'path': false,
},
extensions: ['.js', '*'],
modules: [path.resolve(__dirname, 'js'), 'node_modules', 'src'],
},
entry: path.resolve(__dirname, 'client', 'src', 'index.js'),
output: {
path: path.resolve(__dirname, 'client', 'build'),
filename: '[name].[chunkhash].bundle.js',
},
plugins: [
new Dotenv(),
new HtmlWebPackPlugin({
template: path.resolve(__dirname, 'client', 'public', 'index.html'),
filename: './index.html',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
],
devServer: {
host: '0.0.0.0',
historyApiFallback: true,
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
{
test: /\.css$/,
use: [
'style-loader', 'css-loader',
],
},
{
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
type: 'asset',
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
},
],
},
],
},
};