mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(vite): disable assignement in replace plugin
This commit is contained in:
parent
4552d39c4d
commit
37ba586300
@ -151,6 +151,7 @@ export async function bundle (nuxt: Nuxt) {
|
|||||||
|
|
||||||
nuxt.hook('vite:extendConfig', (config) => {
|
nuxt.hook('vite:extendConfig', (config) => {
|
||||||
config.plugins!.push(replace({
|
config.plugins!.push(replace({
|
||||||
|
preventAssignment: true,
|
||||||
...Object.fromEntries(Object.entries(config.define!).filter(([key]) => key.startsWith('process.')).map(([key, value]) => [key.replace('process.', 'import.meta.'), JSON.stringify(value)]))
|
...Object.fromEntries(Object.entries(config.define!).filter(([key]) => key.startsWith('process.')).map(([key, value]) => [key.replace('process.', 'import.meta.'), JSON.stringify(value)]))
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user