-
Notifications
You must be signed in to change notification settings - Fork 47
/
webpack.config.js
57 lines (53 loc) · 1.22 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const HtmlWebPackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");
const dotenv = require("dotenv");
const trimFieldOrder = require("./src/utils/trimFieldOrder");
dotenv.config();
process.env.FIELD_ORDER = trimFieldOrder(process.env.FIELD_ORDER);
process.env.HOMEPAGE_FIELD_ORDER = trimFieldOrder(
process.env.HOMEPAGE_FIELD_ORDER
);
const htmlPlugin = new HtmlWebPackPlugin({
template: "./public/index.html",
filename: "./index.html"
});
module.exports = {
output: {
publicPath: "/",
filename: "bundle.js",
library: ["env"]
},
entry: "./src/index.dev.js",
mode: "development",
module: {
rules: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: "babel-loader" },
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
plugins: [
htmlPlugin,
new webpack.EnvironmentPlugin([
"AIRTABLE_API_KEY",
"BASE_ID",
"TABLE_ID",
"VIEW",
"FIELD_ORDER",
"HOMEPAGE_FIELD_ORDER",
"HEADER_TITLE",
"SITE_TITLE",
"PAGE_TITLE_COLUMN",
"MARKDOWN_FIELDS",
"SITE_DESCRIPTION"
])
],
devServer: {
port: 8080,
historyApiFallback: {
disableDotRule: true
}
}
};