-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
64 lines (63 loc) · 1.4 KB
/
webpack.config.dev.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
52
53
54
55
56
57
58
59
60
61
62
63
64
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
/**
* Webpack Development Configuration
*/
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: `${path.resolve(__dirname, './src')}/index.tsx`,
output: {
path: path.resolve(__dirname, './dist'),
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
},
}),
new HtmlWebpackPlugin({
template: './src/index.html',
}),
],
module: {
rules: [
{
test: /\.tsx?$/,
enforce: 'pre',
loader: 'tslint-loader',
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
configFile: 'tsconfig.json',
},
},
{
test: /\.s(a|c)ss$/,
loader: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
},
{
test: /\.(pdf|ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
loader: 'file-loader',
query: {
name: 'assets/[name].[hash:8].[ext]',
},
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
},
devServer: {
port: 8080,
open: true,
historyApiFallback: true,
contentBase: path.join(__dirname, 'dist'),
overlay: true,
},
};