Skip to content

Commit

Permalink
fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yohamta committed Aug 11, 2023
1 parent fe1f8c9 commit 1fe1a38
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:

- name: Copy web assets
run: |
cp ui/dist/*.js ./internal/web/handlers/assets/js/
cp ui/dist/*.js ./internal/web/handlers/assets/
cp ui/dist/*.woff ./internal/web/handlers/assets/
cp ui/dist/*.woff2 ./internal/web/handlers/assets/
- name: Run protoc
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Copy web assets
run: |
cp ui/dist/*.js ./internal/web/handlers/assets/js/
cp ui/dist/* ./internal/web/handlers/assets/js/
- name: Cache Go modules
uses: actions/cache@v1
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
bin/*
dist/
internal/web/handlers/assets/fonts/*
internal/web/handlers/assets/js/*
!internal/web/handlers/assets/js/.gitkeep
internal/web/handlers/assets/*
!internal/web/handlers/assets/.gitkeep
internal/**/*.pb.go

# NVM
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ build: build-ui build-dir gen-pb build-bin
build-ui:
@cd ui; \
yarn && yarn build
@cp ui/dist/*.js ./internal/web/handlers/assets/js/
@cp ui/dist/*.js ./internal/web/handlers/assets/
@cp ui/dist/*.woff ./internal/web/handlers/assets/
@cp ui/dist/*.woff2 ./internal/web/handlers/assets/

test:
@go test -v ./...
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/web/handlers/templates/base.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
}
</script>
<script defer="defer" src="/assets/js/bundle.js?v={{ version }}"></script>
<script defer="defer" src="/assets/bundle.js?v={{ version }}"></script>
</head>
<body>
{{template "content" .}}
Expand Down
3 changes: 0 additions & 3 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { SWRConfig } from 'swr';
import fetchJson from './lib/fetchJson';
import Search from './pages/search';

import "@fontsource/inter"
import "@fontsource/inter/100.css"

export type Config = {
title: string;
navbarColor: string;
Expand Down
5 changes: 5 additions & 0 deletions ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import App, { Config } from './App';
import './styles/styles.css';
import './styles/prism.css';

import "@fontsource/inter"
import "@fontsource/inter/300.css"
import "@fontsource/inter/400.css"
import "@fontsource/inter/500.css"
import "@fontsource/inter/600.css"
import '@fontsource/roboto/300.css';
import '@fontsource/roboto/400.css';
import '@fontsource/roboto/500.css';
Expand Down
2 changes: 1 addition & 1 deletion ui/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = merge(common, {
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/assets/js/',
publicPath: '/assets/',
clean: true,
},
});

0 comments on commit 1fe1a38

Please sign in to comment.