mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
feat(vite): replace global
with globalThis
(#4958)
This commit is contained in:
parent
8767b7e3e1
commit
17f9c54a79
@ -20,6 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "^3.0.0-rc.3",
|
||||
"@rollup/plugin-replace": "^4.0.0",
|
||||
"@vitejs/plugin-vue": "^2.3.3",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
||||
"autoprefixer": "^10.4.7",
|
||||
|
@ -4,6 +4,7 @@ import type { Nuxt } from '@nuxt/schema'
|
||||
import type { InlineConfig, SSROptions } from 'vite'
|
||||
import { logger, isIgnored } from '@nuxt/kit'
|
||||
import type { Options } from '@vitejs/plugin-vue'
|
||||
import replace from '@rollup/plugin-replace'
|
||||
import { sanitizeFilePath } from 'mlly'
|
||||
import { getPort } from 'get-port-please'
|
||||
import { buildClient } from './client'
|
||||
@ -64,6 +65,10 @@ export async function bundle (nuxt: Nuxt) {
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
replace({
|
||||
...Object.fromEntries([';', '(', '{', '}', ' ', '\t', '\n'].map(d => [`${d}global.`, `${d}globalThis.`])),
|
||||
preventAssignment: true
|
||||
}),
|
||||
virtual(nuxt.vfs),
|
||||
DynamicBasePlugin.vite({ sourcemap: nuxt.options.sourcemap })
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user