forked from DylanJu/react-pure-ssr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
51 lines (45 loc) · 1.13 KB
/
webpack.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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
mode: 'development',
entry: './src/index.tsx',
devServer: {
historyApiFallback: true,
inline: true,
port: 3000,
hot: true,
publicPath: '/',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: ['babel-loader', 'ts-loader'],
},
{
test: /\.(scss|css)$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
alias: {
pages: path.resolve('src/pages/'),
components: path.resolve('src/components/'),
actions: path.resolve('src/store/actions/'),
reducers: path.resolve('src/store/reducers/'),
util: path.resolve('src/util/'),
},
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'public/index_dev.html',
}),
],
};