-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
68 lines (67 loc) · 1.77 KB
/
webpack.config.dev.js
File metadata and controls
68 lines (67 loc) · 1.77 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
67
68
const HtmlWebPackPlugin = require('html-webpack-plugin');
module.exports = {
target: 'web',
mode: 'development',
entry: './src/index.ts',
output: {
publicPath: '/',
},
devServer: {
host: '0.0.0.0', // Required for working inside a docker container
port: 3001,
overlay: true,
historyApiFallback: true, // 404 responses will fall back to index.html. Required for using react-router-dom
// disableHostCheck: true // Might have to be enabled in order to run dev server in docker container
},
devtool: 'source-map', // Remove this when in production, takes alot of space!
resolve: {
// This is the order in which extensions are tested against imports
// e.g we can use "import File from '../path/to/file';" instead of "import File from '../path/to/file.ts';""
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
module: {
rules: [
{
test: /\.(t|j)sx?$/,
use: { loader: 'ts-loader' },
exclude: /node_modules/,
},
{
test: /\.glsl$/,
loader: 'webpack-glsl-loader',
},
{
test: /\.scss$/,
// Order of modules matters
use: [
process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
},
{
test: /\.(jpg|png|svg|gif|pdf|webp)$/,
use: ['file-loader'],
},
{
//Load fonts
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: ['file-loader'],
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: { minimize: true },
},
],
},
],
},
plugins: [
new HtmlWebPackPlugin({
template: './src/index.html',
}),
],
};