forked from karmats/gocd-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
39 lines (38 loc) · 1.04 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 webpack = require("webpack");
const conf = require("./app-config");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
entry: "./client/index.jsx",
module: {
rules: [
{
test: /.jsx?$/,
use: {
loader: "babel-loader"
},
include: path.join(__dirname, "client")
}
]
},
plugins: [
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ["dist", "assets/js"]
}),
new webpack.DefinePlugin({
"process.env": {
GO_SERVER_URL: `'${conf.goServerUrl}'`,
ENABLE_DARK_THEME: conf.enableDarkTheme,
SWITCH_BETWEEN_PAGES_INTERVAL: conf.switchBetweenPagesInterval,
SHOW_BUILD_LABELS: conf.showBuildLabels,
LINK_TO_PIPELINE_IN_GO: conf.linkToPipelineInGo,
HIDE_WEATHER_ICONS: conf.hideWeatherIcons
}
}),
// Ignore all locale files of moment.js
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
],
resolve: {
extensions: [".js", ".jsx"]
}
};