Skip to content

Commit

Permalink
feat: support import.meta.* for vite
Browse files Browse the repository at this point in the history
  • Loading branch information
wattanx committed Aug 25, 2024
1 parent 0302405 commit 8fa0cbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/bridge/src/vite/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export async function buildClient (ctx: ViteBuildContext) {
'process.static': false,
// use `process.client` instead. `process.browser` is deprecated
'process.browser': true,
'import.meta.client': true,
'import.meta.server': false,
'import.meta.browser': true,
'import.meta.nitro': false,
'import.meta.prerender': false,

Check failure on line 51 in packages/bridge/src/vite/client.ts

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed
'module.hot': false
},
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite/client'),
Expand Down
5 changes: 4 additions & 1 deletion packages/bridge/src/vite/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export async function buildServer (ctx: ViteBuildContext) {
'process.client': false,
'process.static': false,
// use `process.client` instead. `process.browser` is deprecated
'process.browser': false
'process.browser': false,
'import.meta.server': true,
'import.meta.client': false,
'import.meta.browser': false,

Check failure on line 55 in packages/bridge/src/vite/server.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected trailing comma
},
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite/server'),
resolve: {
Expand Down

0 comments on commit 8fa0cbb

Please sign in to comment.