Skip to content

Commit

Permalink
chore: pin rollup to v4 (#24814)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 18, 2023
1 parent 800902d commit 2c10123
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 180 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -35,6 +35,7 @@
"@nuxt/test-utils": "3.9.0-alpha.1",
"@nuxt/vite-builder": "workspace:*",
"@nuxt/webpack-builder": "workspace:*",
"rollup": "^4.7.0",
"nuxt": "workspace:*",
"vite": "5.0.10",
"vue": "3.3.11",
Expand Down
1 change: 0 additions & 1 deletion packages/nuxt/src/core/nitro.ts
Expand Up @@ -335,7 +335,6 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
nitroConfig.rollupConfig!.plugins = await nitroConfig.rollupConfig!.plugins || []
nitroConfig.rollupConfig!.plugins = Array.isArray(nitroConfig.rollupConfig!.plugins) ? nitroConfig.rollupConfig!.plugins : [nitroConfig.rollupConfig!.plugins]
nitroConfig.rollupConfig!.plugins!.push(
// @ts-expect-error rollup 4 types
ImportProtectionPlugin.rollup({
rootDir: nuxt.options.rootDir,
patterns: [
Expand Down
2 changes: 0 additions & 2 deletions packages/vite/src/vite.ts
Expand Up @@ -103,7 +103,6 @@ export const bundle: NuxtBuilder['bundle'] = async (nuxt) => {
rootDir: nuxt.options.rootDir,
composables: nuxt.options.optimization.keyedComposables
}),
// @ts-expect-error types not compatible yet in `@rollup/plugin-replace`
replace({
...Object.fromEntries([';', '(', '{', '}', ' ', '\t', '\n'].map(d => [`${d}global.`, `${d}globalThis.`])),
preventAssignment: true
Expand Down Expand Up @@ -152,7 +151,6 @@ export const bundle: NuxtBuilder['bundle'] = async (nuxt) => {
await nuxt.callHook('vite:extend', ctx)

nuxt.hook('vite:extendConfig', (config) => {
// @ts-expect-error types not compatible yet in `@rollup/plugin-replace`
config.plugins!.push(replace({
preventAssignment: true,
...Object.fromEntries(Object.entries(config.define!).filter(([key]) => key.startsWith('import.meta.')))
Expand Down

0 comments on commit 2c10123

Please sign in to comment.