-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
35 lines (34 loc) · 965 Bytes
/
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
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
entry: {
main: "./src/index.js",
animejs: "./src/anime.js",
},
output: {
filename: "[name].[contentHash].js",
path: path.resolve(__dirname, "public")
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.html$/,
use: "html-loader"
},
{
test: /\.(png|jpg|gif)$/,
loader: "file-loader",
options: {
name: "[name].[contentHash].[ext]"
}
}
]
},
plugins: [new HtmlWebpackPlugin({ template: "./src/index.html" }), new CleanWebpackPlugin()]
}