-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.common.js
46 lines (45 loc) · 960 Bytes
/
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
40
41
42
43
44
45
46
const path = require("path")
const Dotenv = require("dotenv-webpack")
require("dotenv").config({ path: path.resolve(__dirname, "./.env") })
const HtmlWebpackPlugin = require("html-webpack-plugin")
module.exports = {
output: {
path: path.join(__dirname, "/static"),
filename: "main.js",
publicPath: "/",
},
entry: {
main: "./client/index.js",
},
module: {
rules: [
{
test: /\.(jsx|js)$/,
exclude: /node-modules/,
use: "babel-loader",
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader", "postcss-loader"],
},
{
test: /\.(svg|png|jpe?g|gif)$/i,
use: [
{
loader: "file-loader",
},
],
},
],
},
plugins: [
new Dotenv(),
new HtmlWebpackPlugin({
title: "Winder -- Find your soulmate",
script: "/main.js",
template: path.join(__dirname, "client", "index.html"),
favicon: path.join(__dirname, "client/assets/images/logo-head.png"),
inject: false,
}),
],
}