Skip to content

Commit

Permalink
put gov uk design system assets into a static directory
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldo committed Mar 10, 2025
1 parent 81a27db commit 4ffcb08
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ amplifyconfiguration*

# GOV.UK assets copied into public dir
public/assets
public/static/assets

# Node dependencies
node_modules
Expand Down
2 changes: 1 addition & 1 deletion amplify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ frontend:
- npm ci
build:
commands:
- cp -a node_modules/govuk-frontend/dist/govuk/assets public/assets
- cp -a node_modules/govuk-frontend/dist/govuk/assets public/static/assets
- npm run build
artifacts:
baseDirectory: .amplify-hosting
Expand Down
4 changes: 3 additions & 1 deletion assets/scss/main.scss
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@use "../../node_modules/govuk-frontend/dist/govuk/index";
@use "../../node_modules/govuk-frontend/dist/govuk/index" with (
$govuk-assets-path: "/static/assets/"
);
3 changes: 1 addition & 2 deletions buildspec/build_front_end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ phases:
- zip -r nuxt-lambda.zip .
- cd ../..
- mv .output/server/nuxt-lambda.zip nuxt-lambda.zip
- rsync -Hav ./node_modules/govuk-frontend/dist/govuk/assets/ ./_assets/
- rsync -Hav .output/public/ ./static/
- rsync -Hav ./node_modules/govuk-frontend/dist/govuk/assets/ ./static/assets/

post_build:
commands:
Expand All @@ -27,4 +27,3 @@ artifacts:
files:
- nuxt-lambda.zip
- 'static/**/*'
- '_assets/**/*'
1 change: 0 additions & 1 deletion buildspec/deploy_front_end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ phases:
- export AWS_PROFILE=ci_server
- ls -al $CODEBUILD_SRC_DIR_build_frontend_output
- aws s3 sync --delete $CODEBUILD_SRC_DIR_build_frontend_output s3://epb-ecaas-front-end-s3-bucket --exclude "nuxt-lambda*"
- aws s3 sync --delete $CODEBUILD_SRC_DIR_build_frontend_output/_assets/ s3://epb-ecaas-front-end-s3-bucket/assets/
- aws lambda update-function-code --function-name front-end-lambda --zip-file fileb://$CODEBUILD_SRC_DIR_build_frontend_output/nuxt-lambda.zip
post_build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineNuxtConfig({
viteStaticCopy({
targets: [{
src: 'node_modules/govuk-frontend/dist/govuk/assets/*',
dest: 'assets'
dest: 'static/assets'
}]
})
]
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ffcb08

Please sign in to comment.