-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack-client.config.js
44 lines (43 loc) · 999 Bytes
/
webpack-client.config.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
const {resolve} = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
mode: "production",
target:"web",
entry: "./public/ts/index.ts",
output: {
path:process.env.MY_ENV !=="production"? resolve(__dirname + "/public/js"): resolve(__dirname + "/dist/public"),
filename: "[name].min.js"
},
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
"style-loader",
"css-loader",
"sass-loader",
],
},
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
{
test: /\.ejs$/,
loader: "ejs-loader",
options: {
variable: "data",
interpolate : "\\{\\{(.+?)\\}\\}",
evaluate : "\\[\\[(.+?)\\]\\]"
}
}
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
plugins: [new HtmlWebpackPlugin({
_: "underscore"
})],
};