Skip to content

Commit

Permalink
feat: change build directory and reference for buildspec.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
leleOFA committed Oct 9, 2024
1 parent 6d9f641 commit 672b0db
Show file tree
Hide file tree
Showing 5 changed files with 1,239 additions and 359 deletions.
8 changes: 4 additions & 4 deletions cra_buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ phases:
commands:
- echo saving commit id to file
- export COMMIT_ID=$(git rev-parse --verify HEAD)
- echo $COMMIT_ID > build/commit_id.txt
- echo $COMMIT_ID > .next/commit_id.txt
- echo gzipping and pushing artifact to s3
- cd build
- cd .next
- tar c * | gzip | aws s3 cp - "s3://${CI_ARTIFACT_BUCKET}/${GITHUB_PRJ_NAME}/commits/${COMMIT_ID}/${PACKAGE_NAME}.tar.gz"
- |
BRANCH_NAME=$(echo $CODEBUILD_WEBHOOK_HEAD_REF | sed 's/refs\/heads\///'); export BRANCH_NAME=${BRANCH_NAME:=$GIT_DEFAULT_BRANCH}
Expand All @@ -33,6 +33,6 @@ phases:
cat ci_event.json
aws events put-events --entries file://ci_event.json
artifacts:
base-directory: build
base-directory: .next
files:
- '**/*'
- "**/*"
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
15 changes: 6 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");

const nextConfig = {
output: 'export',
output: "export",
reactStrictMode: true,
trailingSlash: true,
distDir: 'build',
transpilePackages: [
'@pagopa/mui-italia',
],
distDir: ".next",
transpilePackages: ["@pagopa/mui-italia"],
modularizeImports: {
"@mui/icons-material": {
transform: "@mui/icons-material/{{member}}",
},
"@mui/material": {
transform: "@mui/material/{{member}}",
},
}
},
};
/**
* As soon as RADD sperimentation start, all page extension mapping needs to be remove.
* It can affect building phase drastically.
* In addition to this, also the pages in "punti di ritiro" folder should have their extensions
* changed from ".dev.tsx" to ".tsx"
*
*
* What this code does:
* This code will allow you to use .dev.xxx extensions for dev-only pages, and .xxx for pages that are publicly accessible.
*
*
* More info here https://dev.to/tylerlwsmith/development-only-pages-in-nextjs-4fgo
*/
module.exports = (phase, { defaultConfig }) => ({
Expand All @@ -41,4 +39,3 @@ module.exports = (phase, { defaultConfig }) => ({
})
.flat(),
});

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"@mui/lab": "5.0.0-alpha.119",
"@mui/material": "5.11.8",
"@pagopa/mui-italia": "^1.3.0",
"next": "14.1.1",
"next": "^14.2.14",
"papaparse": "^5.4.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vega": "^5.27.0",
"vega-embed": "^6.24.0",
"vega-interpreter": "^1.0.5",
Expand All @@ -34,7 +34,7 @@
"@types/react-dom": "18.2.0",
"@typescript-eslint/eslint-plugin": "7.7.1",
"eslint": "9.1.1",
"eslint-config-next": "^13.1.2",
"eslint-config-next": "^14.2.14",
"eslint-config-prettier": "^8.3.0",
"next-transpile-modules": "^9.0.0",
"prettier": "^2.4.1",
Expand Down
Loading

0 comments on commit 672b0db

Please sign in to comment.