-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.ts
48 lines (47 loc) · 1.07 KB
/
webpack.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
/** @format */
const path = require("path")
const HtmlWebpackPlugin = require("html-webpack-plugin")
const htmlWebpackPlugin = new HtmlWebpackPlugin({
template: path.join(__dirname, "demo/index.html"),
filename: "./index.html",
})
module.exports = {
entry: path.join(__dirname, "demo/src/index"),
output: {
path: path.resolve(__dirname, "demo/dist"),
},
target: "web",
module: {
rules: [
{
test: /\.s?css$/i,
use: ["style-loader", "css-loader", "sass-loader"],
},
{
test: /\.(t|j)sx?$/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-typescript"],
plugins: [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
],
},
},
exclude: /node_modules/,
},
],
},
plugins: [htmlWebpackPlugin],
resolve: {
modules: [path.resolve(__dirname, "./src"), "node_modules"],
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
devServer: {
port: 8646,
open: true,
hot: true,
},
}