Skip to content

Commit

Permalink
Use fronts-client-v2 for assets directory, which sits nicely alongsid…
Browse files Browse the repository at this point in the history
…e fronts-client-v1 (previously v2 was simply fronts-client)
  • Loading branch information
jonathonherbert committed Mar 1, 2024
1 parent ebc8fbe commit 9790fd3
Show file tree
Hide file tree
Showing 11 changed files with 471 additions and 386 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ developer.properties
.cache

##
public/fronts-client/dist
public/fronts-client-v2/dist
public/fronts-client-v1/
fronts-client/.vscode
**/manifest.json
.vscode
.vite

metals.sbt
.metals
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/V2App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class V2App(isDev: Boolean, val acl: Acl, dynamoClient: DynamoDbClient, val deps
import org.scanamo.generic.auto._
val userDataTable = Table[UserData](config.faciatool.userDataTable)

val jsFileName = "dist/app.bundle.js"
val jsFileName = "dist/index.js"
val faviconDirectoryName = "favicon/"

val jsLocation: String = routes.V2Assets.at(jsFileName).toString
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/V2Assets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import scala.concurrent.ExecutionContext

class V2Assets(val assets: Assets)(implicit ec: ExecutionContext) {
def at(file: String, relativePath: String = "") = model.NoCache {
assets.at("/public/fronts-client", relativePath + file)
assets.at("/public/fronts-client-v2", relativePath + file)
}
}
2 changes: 1 addition & 1 deletion fronts-client/integration/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module.exports = async () =>
: res.sendFile(
path.join(
__dirname,
'../../../public/fronts-client/dist',
'../../../public/build',
req.params.file
)
)
Expand Down
4 changes: 2 additions & 2 deletions fronts-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
"ts-optchain": "^0.1.2",
"tti-polyfill": "^0.2.2",
"uuid": "^3.2.1",
"vite": "^4.3.3",
"vite-tsconfig-paths": "^4.2.0"
"vite": "^5.1.4",
"vite-tsconfig-paths": "^4.3.1"
},
"resolutions": {
"chokidar": "^3.4.0",
Expand Down
2 changes: 1 addition & 1 deletion fronts-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"sourceMap": true,
"baseUrl": "src",
"strict": true,
"outDir": "../../public/fronts-client/dist",
"outDir": "../../public/fronts-client-v2/dist",
"skipLibCheck": true,
},
"exclude": [
Expand Down
11 changes: 6 additions & 5 deletions fronts-client/vite.config.ts → fronts-client/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tsconfigPaths from 'vite-tsconfig-paths'
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
plugins: [tsconfigPaths(), react()],
base: '/assets/fronts-client',
build: {
manifest: true,
rollupOptions: {
input: '/src/index.tsx',
output: {
entryFileNames: `build/[name].js`,
chunkFileNames: `build/[name].js`,
assetFileNames: `build/[name].[ext]`,
entryFileNames: `dist/[name].js`,
chunkFileNames: `dist/[name].js`,
assetFileNames: `dist/[name].[ext]`,
},
},
outDir: '../public/',
outDir: '../public/fronts-client-v2',
},
server: {
origin: 'http://localhost:5173',
Expand Down
830 changes: 456 additions & 374 deletions fronts-client/yarn.lock

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit 9790fd3

Please sign in to comment.