Skip to content

Commit

Permalink
CSCEXAM-000 Experminent with Vite build engine
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Aug 14, 2024
1 parent 2bbd906 commit c97c326
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
9 changes: 4 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"prefix": "xm",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:browser-esbuild",
"options": {
"outputPath": "dist/exam",
"index": "ui/src/index.html",
"main": "ui/src/main.ts",
"polyfills": "ui/src/polyfills.ts",
"polyfills": ["@angular/localize/init", "ui/src/polyfills.ts"],
"tsConfig": "ui/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["ui/src/favicon.ico", "ui/src/assets"],
Expand Down Expand Up @@ -60,7 +60,6 @@
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
Expand All @@ -71,8 +70,8 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"proxyConfig": "ui/src/proxy.conf.js",
"buildTarget": "exam:build"
"buildTarget": "exam:build",
"proxyConfig": "ui/src/proxy.conf.js"
},
"configurations": {
"production": {
Expand Down
2 changes: 1 addition & 1 deletion app/system/AuditLogFilter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AuditLogFilter @Inject() (implicit val mat: Materializer, ec: ExecutionCon
override def apply(next: RequestHeader => Future[Result])(rh: RequestHeader): Future[Result] =
val (method, session, uri) = (rh.method, rh.session, rh.uri)
// No point in logging asset requests. Also requests with bodies are handled down the line
if !uri.startsWith("/assets") && !rh.hasBody then
if Seq("app/", "integration/").exists(uri.tail.startsWith) && !rh.hasBody then
val userString =
if session.isEmpty || session.get("id").isEmpty then "user <NULL>"
else
Expand Down
27 changes: 14 additions & 13 deletions ui/src/proxy.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
// SPDX-License-Identifier: EUPL-1.2

const PROXY_CONFIG = {
"**": {
"target": "http://localhost:9000",
"secure": false,
"bypass": (req) => {
if (req.headers.accept && req.headers.accept.indexOf("html") !== -1) {
console.log("Skipping proxy for browser request.");
return "/index.html";
}
}
}
};

module.exports = PROXY_CONFIG;
'/app/**': {
target: 'http://localhost:9000',
secure: false,
logLevel: 'debug',
bypass: (req) => {
if (req.headers.accept && req.headers.accept.indexOf('html') !== -1) {
console.log('Skipping proxy for browser request.');
return '/index.html';
}
},
},
};

module.exports = PROXY_CONFIG;

0 comments on commit c97c326

Please sign in to comment.