-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
56 lines (55 loc) · 1.15 KB
/
webpack.config.js
File metadata and controls
56 lines (55 loc) · 1.15 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
52
53
54
55
56
let path = require("path");
let ENV = require("./env");
module.exports = {
mode: "development",
devtool: ENV.hasOwnProperty("devtool") ? ENV.devtool : false,
entry: {
main: "./view/src/index.js",
},
output: {
filename: "[name].js",
chunkFilename: "[name].bundle.js",
publicPath: ENV.publicPath,
path: path.resolve(__dirname, "view/static/"),
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.png$/,
use: [
{
loader: "url-loader",
options: {
mimetype: "image/png",
},
},
],
},
],
},
resolve: {
extensions: [".js", ".jsx"], // If no extension is added to the import file, try using these
alias: {
["~"]: path.resolve(__dirname, "view/src"),
},
},
externals: {
axios: "axios",
// "@fortawesome/fontawesome-svg-core":
// "@fortawesome/fontawesome-svg-core",
// "@fortawesome/free-solid-svg-icons":
// "@fortawesome/free-solid-svg-icons",
// "@fortawesome/react-fontawesome": "@fortawesome/react-fontawesome",
},
};