-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
51 lines (50 loc) · 1.44 KB
/
webpack.config.js
File metadata and controls
51 lines (50 loc) · 1.44 KB
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
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const BASE_JS = "./src/client/js/";
module.exports = {
entry: {
main: BASE_JS + "main.js",
videoPlayer: BASE_JS + "videoPlayer.js",
recorder: BASE_JS + "recorder.js",
commentSection: BASE_JS + "commentSection.js",
watchFunction: BASE_JS + "watchFunction.js",
search: BASE_JS + "search.js",
removeSidebar: BASE_JS + "removeSidebar.js",
hoverVideo: BASE_JS + "hoverVideo.js",
},
plugins: [
new MiniCssExtractPlugin({
filename: "css/style.css",
}),
new NodePolyfillPlugin(),
],
output: {
filename: "js/[name].js",
path: path.resolve(__dirname, "assets"),
clean: true,
},
performance: {
hints: false,
},
module: {
rules: [
{
test: /\.js$/,
use: {
//loader를 사용해서 js 파일을 처리
loader: "babel-loader",
options: {
presets: [["@babel/preset-env", { targets: "defaults" }]],
},
},
},
{
test: /\.scss$/,
// webpack은 역순으로 실행되기 때문에 sass-loader를 뒤에 적어준다.
// style-loader 대신 MiniCssExtractPlugin.loader를 사용함으로써 브라우저의 css 처리를 맡긴다.
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
],
},
};