-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.client.js
More file actions
42 lines (41 loc) · 1013 Bytes
/
webpack.dev.client.js
File metadata and controls
42 lines (41 loc) · 1013 Bytes
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
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const stylesHandler = MiniCssExtractPlugin.loader;
module.exports = {
name: "client",
entry: {
client: path.resolve(__dirname, "src/index.tsx"),
},
mode: "development",
output: {
path: path.resolve(__dirname + "/dist/static"),
filename: "[name].[contenthash].js",
publicPath: "",
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
target: "web",
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
configFile: "tsconfig.json",
},
},
{
test: /\.css$/i,
use: [stylesHandler, "css-loader", "postcss-loader"],
},
],
},
plugins: [
new CleanWebpackPlugin(),
new WebpackManifestPlugin(),
new MiniCssExtractPlugin(),
],
};