Skip to content
Snippets Groups Projects
Commit 281e80bb authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Only allow commonjs modules in external dependencies

parent a90ee15a
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,9 @@ export default { ...@@ -26,7 +26,9 @@ export default {
moduleDirectory: path.join(process.cwd(), 'node_modules') moduleDirectory: path.join(process.cwd(), 'node_modules')
} }
}), }),
commonjs(), commonjs({
include: 'node_modules/**'
}),
json(), json(),
replace({ replace({
"process.env.BUILD": '"' + build + '"', "process.env.BUILD": '"' + build + '"',
......
const vars = require("./vars"); import vars from './vars.js';
module.exports = { export default {
getAPiUrl: function(path = "", withPrefix = true) { getAPiUrl: function(path = "", withPrefix = true) {
return vars.apiBaseUrl + (withPrefix ? vars.apiUrlPrefix : "") + path; return vars.apiBaseUrl + (withPrefix ? vars.apiUrlPrefix : "") + path;
}, },
......
var config = undefined;
switch(process.env.BUILD) { switch(process.env.BUILD) {
case "development": case "development":
module.exports = { config = {
apiBaseUrl: 'https://mw-dev.tugraz.at', apiBaseUrl: 'https://mw-dev.tugraz.at',
apiUrlPrefix: '', apiUrlPrefix: '',
keyCloakClientId: 'auth-dev-mw-frontend', keyCloakClientId: 'auth-dev-mw-frontend',
...@@ -9,14 +10,14 @@ switch(process.env.BUILD) { ...@@ -9,14 +10,14 @@ switch(process.env.BUILD) {
break; break;
case "production": case "production":
module.exports = { config = {
apiBaseUrl: 'https://mw.tugraz.at', apiBaseUrl: 'https://mw.tugraz.at',
apiUrlPrefix: '', apiUrlPrefix: '',
keyCloakClientId: 'auth-prod-mw-frontend', keyCloakClientId: 'auth-prod-mw-frontend',
}; };
break; break;
case "demo": case "demo":
module.exports = { config = {
apiBaseUrl: 'https://api-demo.tugraz.at', apiBaseUrl: 'https://api-demo.tugraz.at',
apiUrlPrefix: '', apiUrlPrefix: '',
keyCloakClientId: 'auth-dev-mw-frontend', keyCloakClientId: 'auth-dev-mw-frontend',
...@@ -24,9 +25,11 @@ switch(process.env.BUILD) { ...@@ -24,9 +25,11 @@ switch(process.env.BUILD) {
break; break;
case "local": case "local":
default: default:
module.exports = { config = {
apiBaseUrl: 'http://127.0.0.1:8000', apiBaseUrl: 'http://127.0.0.1:8000',
apiUrlPrefix: '', apiUrlPrefix: '',
keyCloakClientId: 'auth-dev-mw-frontend-local', keyCloakClientId: 'auth-dev-mw-frontend-local',
}; };
} }
export default config;
common @ b30eaa64
Subproject commit 68e0a4f1f1a3ef6e05aca5216bf8684578ec2229 Subproject commit b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment