-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
29 lines (28 loc) · 861 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
29 lines (28 loc) · 861 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
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: "./src/index.js", // Dẫn tới file index.js ta đã tạo
output: {
path: path.join(__dirname, "/build"), // Thư mục chứa file được build ra
filename: "bundle.js" // Tên file được build ra
},
module: {
rules: [
{
test: /\.js$/, // Sẽ sử dụng babel-loader cho những file .js
exclude: /node_modules/, // Loại trừ thư mục node_modules
use: ["babel-loader"]
},
{
test: /\.css$/, // Sử dụng style-loader, css-loader cho file .css
use: ["style-loader", "css-loader"]
}
]
},
// Chứa các plugins sẽ cài đặt trong tương lai
plugins: [
new HtmlWebpackPlugin({
template: "./public/index.html"
})
]
};