Skip to content

Commit

Permalink
Use @-imports in TS runtime code (#50470)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Sese <[email protected]>
  • Loading branch information
peterbe and rsese authored May 6, 2024
1 parent 529f4a8 commit b6f0084
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ COPY --chown=node:node .remotejson-cache* ./.remotejson-cache
COPY --chown=node:node .pageinfo-cache.json.br* ./.pageinfo-cache.json.br
COPY --chown=node:node data ./data
COPY --chown=node:node next.config.js ./
COPY --chown=node:node tsconfig.json ./

EXPOSE $PORT

Expand Down
2 changes: 1 addition & 1 deletion src/frame/lib/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import express from 'express'
import middleware from '../middleware/index.js'
import middleware from '@/frame/middleware/index.js'

function createApp() {
const app = express()
Expand Down
5 changes: 5 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export default {
exclude: ['**/tests/playwright-*.spec.ts'],
// Default is `!process.env.CI`
watch: false,
// vitest doesn't account for tsconfig.json `paths` settings so we have to
// manually set this alias to resolve our TS @-imports
alias: {
'@/': new URL('./src/', import.meta.url).pathname,
},

globalSetup: './src/tests/vitest.setup.ts',
},
Expand Down

0 comments on commit b6f0084

Please sign in to comment.