Skip to content

Commit

Permalink
fix: use upath in more places for better windows support (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 2, 2021
1 parent 475d6b5 commit fcd61db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function writeFile(key: string, value: string) {
const { writeFileSync }: typeof import('fs') = process.client
? ''
: require('fs')
const { join }: typeof import('path') = process.client ? '' : require('path')
const { join }: typeof import('upath') = process.client
? ''
: require('upath')

try {
writeFileSync(join(staticPath, `${key}.json`), value)
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line
const { resolve } = require('path')
const { resolve } = require('upath')

const routes = ['/route/a', '/static/1', '/static/2', '/static/3']
const interval = 3000
Expand Down

1 comment on commit fcd61db

@vercel
Copy link

@vercel vercel bot commented on fcd61db Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.