-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
86 lines (85 loc) · 2.26 KB
/
webpack.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const Dotenv = require("dotenv-webpack");
module.exports = {
entry: "./src/index.tsx",
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
output: {
path: path.join(__dirname, "dist"),
filename: "[name].bundle.min.js",
publicPath: "/"
},
module: {
rules: [
{
test: /\.(tsx|ts)?$/,
loader: "ts-loader",
exclude: "/node_modules/"
},
{
test: /\.(jpg|png|jpeg|bmp|gif|svg|webp)?$/,
loader: "file-loader",
options: {
name: "assets/[name].[hash:8].[ext]"
}
},
{
test: /\.css?$/,
loader: ["style-loader", "css-loader"]
},
{
test: /\.(js)$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: "./public/index.html",
favicon: "./src/assets/favicon.ico",
scriptLoading: "defer",
inject: "head",
cache: true
}),
new Dotenv({
path: path.join(__dirname, "src/.env")
}),
new webpack.EnvironmentPlugin({
HOST_URL: JSON.stringify(process.env.HOST_URL || "HOST_URL"),
S3_URL: JSON.stringify(process.env.S3_URL || "S3_URL"),
VERSION: JSON.stringify(process.env.VERSION || "VERSION"),
HOST_URL: JSON.stringify(process.env.HOST_URL || "HOST_URL"),
NAVER_CLIENT_ID: JSON.stringify(
process.env.NAVER_CLIENT_ID || "NAVER_CLIENT_ID"
),
NAVER_CLIENT_SECRET: JSON.stringify(
process.env.NAVER_CLIENT_SECRET || "NAVER_CLIENT_SECRET"
),
SECURITY_BASE_PLAIN: JSON.stringify(
process.env.SECURITY_BASE_PLAIN || "SECURITY_BASE_PLAIN"
),
SECURITY_PASS_PHRASE: JSON.stringify(
process.env.SECURITY_PASS_PHRASE || "SECURITY_PASS_PHRASE"
),
CHANNEL_PLUGIN_KEY: JSON.stringify(
process.env.CHANNEL_PLUGIN_KEY || "CHANNEL_PLUGIN_KEY"
)
})
],
devServer: {
contentBase: path.join(__dirname, "public"),
inline: true,
hot: true,
historyApiFallback: true,
host: "0.0.0.0"
}
};