-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.client.dev.ts
68 lines (64 loc) · 1.86 KB
/
webpack.client.dev.ts
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
// tslint:disable:object-literal-sort-keys
import webpack from "webpack";
// tslint:disable-next-line:no-var-requires
const ReactLoadablePlugin = require("react-loadable/webpack").ReactLoadablePlugin;
const clientConfig: webpack.Configuration = {
name: "client",
mode: "development",
entry: [
"webpack-hot-middleware/client",
"./src/client.tsx",
],
output: {
publicPath: "/static/",
filename: "[name].js",
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: [
{
loader: "babel-loader",
options: {
babelrc: true,
plugins: ["react-hot-loader/babel"],
},
},
{
loader: "ts-loader",
options: {
compilerOptions: {
module: "esnext",
target: "esnext",
},
},
},
],
},
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: "url-loader",
options: {
limit: 10000,
name: "[name].[hash:8].[ext]",
},
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
plugins: [
new ReactLoadablePlugin({
filename: "./server/react-loadable.json",
}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
],
};
export default clientConfig;