-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
39 lines (38 loc) · 1.02 KB
/
webpack.common.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
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const Dotenv = require("dotenv-webpack");
module.exports = {
entry: {
bundle: path.resolve(__dirname, "src/JS/index.js"),
CitySearch: path.resolve(__dirname, "src/JS/API/CitySearch.js"),
defaultCity: path.resolve(__dirname, "src/JS/API/defaultCity.js"),
geolocation: path.resolve(__dirname, "src/JS/API/geolocation.js"),
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name][contenthash].js",
clean: true,
// assetModuleFilename: "images/[hash][ext][query]"
assetModuleFilename: "[name][ext]",
},
module: {
rules: [
{
test: /\.scss$/i,
use: ["style-loader", "css-loader", "sass-loader"],
},
{
test: /\.(png|svg|jpg|jpeg|gif|ico)$/i,
type: "asset/resource",
},
],
},
plugins: [
new HtmlWebpackPlugin({
title: "UrbanLeaf",
filename: "index.html",
template: "src/index.html",
}),
new Dotenv(),
],
};