From 510ca95a4e6e4f00efa4ba6e40a900ba44ab28dc Mon Sep 17 00:00:00 2001 From: Saku K <6057704+saku-koodari@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:59:24 +0300 Subject: [PATCH] refactor: improve build by pointing the distDir in the frontend app straigth to maven's target/classes/static - folder --- README.md | 4 ++-- frontend/next.config.mjs | 3 +++ pom.xml | 32 -------------------------------- 3 files changed, 5 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 8d3c0e27..2acc5862 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ jonka asentamisen jälkeen IDEA:n voi laittaa formatoimaan tallentamisen yhteyde # Tarkista formatointi. Voit formatoida koodin ajamalla `ktlint --format` ktlint -# paketoi projektin. Tämä myöskin kopioi node-resurssit target/staticin alle +# paketoi projektin. mvn package - # Voit käyttää tätä jos ajat ympäristöä terminaalin kautta§§ + # Voit käyttää tätä jos ajat ympäristöä terminaalin kautta ./mvnw spring-boot:run ``` diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 480a7cf9..1534eb9b 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -5,6 +5,9 @@ const nextConfig = { // https://nextjs.org/docs/app/building-your-application/deploying/static-exports output: "export", + // point the files straight to maven's target files. + distDir: "../target/classes/static", + // The build fails without this. images: { unoptimized: true diff --git a/pom.xml b/pom.xml index a7ec4509..6071426e 100644 --- a/pom.xml +++ b/pom.xml @@ -188,38 +188,6 @@ - - - - org.apache.maven.plugins - maven-resources-plugin - 3.3.1 - - - copy-react-build - package - - copy-resources - - - ${project.build.outputDirectory}/static - - - ${frontendDir}/out - false - - **/* - - - - - - - - - - -