Fixes Docker Angular Build Process

This commit is contained in:
2023-10-11 19:56:06 -03:00
parent a03fc7e09e
commit 26e942a532
9 changed files with 22 additions and 181 deletions

7
src/assets/env.sample.js Normal file
View File

@@ -0,0 +1,7 @@
(function (window) {
window['env'] = window['env'] || {};
// Environment variables
window['env']['backendPath'] = '${BACKEND_URL}';
window['env']['backendOAuthPath'] = '${BACKEND_OAUTH_URL}';
})(this);

View File

@@ -1,5 +1,5 @@
export const environment = {
production: true,
backendPath: process.env['BACKEND_URL'],
backendOAuthPath: process.env['BACKEND_OAUTH_URL']
backendPath: (<any>window).env['BACKEND_URL'],
backendOAuthPath: (<any>window).env['BACKEND_OAUTH_URL']
};

View File

@@ -19,6 +19,9 @@
<link rel="manifest" href="manifest.webmanifest">
<link rel="preconnect" href="https://hideyoshi-portfolio-dev.s3.amazonaws.com">
<!-- Loading environment variables -->
<script src="assets/env.js"></script>
</head>
<body>

View File

@@ -1,11 +0,0 @@
import { EnvironmentPlugin } from 'webpack'
module.exports = {
plugins: [
new EnvironmentPlugin({
'BACKEND_URL': 'https://api.hideyoshi.com.br',
'BACKEND_OAUTH_URL': 'https://api.hideyoshi.com.br'
})
]
}