-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
51 lines (46 loc) · 1.49 KB
/
vue.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
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const DefinePlugin = require("webpack").DefinePlugin;
module.exports = {
transpileDependencies: ["vuetify", "feathers-vuex"],
pwa: {
name: "Jonathan's Movies",
themeColor: "#365ED4",
msTileColor: "#000000",
appleMobileWebAppCapable: "yes",
appleMobileWebAppStatusBarStyle: "black",
},
configureWebpack: (_config) => {
//TODO: Should this all be defined without this logic? Probably!
let facebookUrl;
if (process.env.BRANCH && process.env.BRANCH.trim() === "develop") {
facebookUrl = "https://staging-api.jonathansmovies.com/auth/facebook";
} else if (process.env.NODE_ENV === "production") {
facebookUrl = "https://api.jonathansmovies.com/auth/facebook";
} else {
facebookUrl = "http://localhost:3030/auth/facebook";
}
let apiUrl;
if (process.env.BRANCH && process.env.BRANCH.trim() === "develop") {
apiUrl = "https://staging-api.jonathansmovies.com";
} else if (process.env.NODE_ENV === "production") {
apiUrl = "https://api.jonathansmovies.com";
} else {
apiUrl = "http://localhost:3030";
}
let plugins = [
new DefinePlugin({
"process.env": {
FACEBOOK_URL: JSON.stringify(facebookUrl),
API_URL: JSON.stringify(apiUrl),
},
}),
];
if (process.env.ANALYZE) {
plugins.push(new BundleAnalyzerPlugin());
}
return {
plugins: plugins,
};
},
};