diff --git a/package.json b/package.json index 4ae32724899a1c..446dba49d5d39f 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "prompts": "^2.4.2", "resolve": "^1.22.1", "rimraf": "^3.0.2", - "rollup": "^2.79.1", + "rollup": "~3.2.3", "rollup-plugin-license": "^2.9.0", "semver": "^7.3.8", "simple-git-hooks": "^2.8.1", diff --git a/packages/plugin-legacy/src/index.ts b/packages/plugin-legacy/src/index.ts index 203cad9dc293c6..620976e30add76 100644 --- a/packages/plugin-legacy/src/index.ts +++ b/packages/plugin-legacy/src/index.ts @@ -415,7 +415,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] { configFile: false, compact: !!config.build.minify, sourceMaps, - inputSourceMap: sourceMaps ? chunk.map : undefined, + inputSourceMap: undefined, // sourceMaps ? chunk.map : undefined, `.map` TODO: moved to OutputChunk? presets: [ // forcing our plugin to run before preset-env by wrapping it in a // preset so we can catch the injected import statements... diff --git a/packages/plugin-vue/package.json b/packages/plugin-vue/package.json index 49d2d9fca5e6c7..511d5f9815d01f 100644 --- a/packages/plugin-vue/package.json +++ b/packages/plugin-vue/package.json @@ -42,7 +42,7 @@ "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "debug": "^4.3.4", - "rollup": "^2.79.1", + "rollup": "~3.2.3", "slash": "^5.0.0", "source-map": "^0.6.1", "vite": "workspace:*", diff --git a/packages/vite/LICENSE.md b/packages/vite/LICENSE.md index 042a589f01d17c..3cbbd7d9679694 100644 --- a/packages/vite/LICENSE.md +++ b/packages/vite/LICENSE.md @@ -535,28 +535,6 @@ License: MIT By: Rich Harris Repository: rollup/plugins -> The MIT License (MIT) -> -> Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - --------------------------------------- ## acorn @@ -822,32 +800,6 @@ Repository: http://github.com/substack/node-commondir.git --------------------------------------- -## concat-map -License: MIT -By: James Halliday -Repository: git://github.com/substack/node-concat-map.git - -> This software is released under the MIT license: -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of -> this software and associated documentation files (the "Software"), to deal in -> the Software without restriction, including without limitation the rights to -> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -> the Software, and to permit persons to whom the Software is furnished to do so, -> subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------- - ## connect License: MIT By: TJ Holowaychuk, Douglas Christopher Wilson, Jonathan Ong, Tim Caswell @@ -1555,7 +1507,7 @@ Repository: git://github.com/isaacs/node-glob.git > The ISC License > -> Copyright (c) Isaac Z. Schlueter and Contributors +> Copyright (c) 2009-2022 Isaac Z. Schlueter and Contributors > > Permission to use, copy, modify, and/or distribute this software for any > purpose with or without fee is hereby granted, provided that the above @@ -1568,12 +1520,6 @@ Repository: git://github.com/isaacs/node-glob.git > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -> -> ## Glob Logo -> -> Glob's logo created by Tanya Brassie , licensed -> under a Creative Commons Attribution-ShareAlike 4.0 International License -> https://creativecommons.org/licenses/by-sa/4.0/ --------------------------------------- @@ -2078,7 +2024,7 @@ Repository: git://github.com/isaacs/minimatch.git > The ISC License > -> Copyright (c) Isaac Z. Schlueter and Contributors +> Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors > > Permission to use, copy, modify, and/or distribute this software for any > purpose with or without fee is hereby granted, provided that the above @@ -2395,35 +2341,6 @@ Repository: pillarjs/parseurl --------------------------------------- -## path-is-absolute -License: MIT -By: Sindre Sorhus -Repository: sindresorhus/path-is-absolute - -> The MIT License (MIT) -> -> Copyright (c) Sindre Sorhus (sindresorhus.com) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## path-key License: MIT By: Sindre Sorhus diff --git a/packages/vite/package.json b/packages/vite/package.json index 54e5340bb99080..077316fe03c081 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -61,7 +61,7 @@ "esbuild": "^0.15.9", "postcss": "^8.4.18", "resolve": "^1.22.1", - "rollup": "^2.79.1" + "rollup": "~3.2.3" }, "optionalDependencies": { "fsevents": "~2.3.2" diff --git a/packages/vite/rollup.config.ts b/packages/vite/rollup.config.ts index c333e66577f8d5..e25beca7b2fd6e 100644 --- a/packages/vite/rollup.config.ts +++ b/packages/vite/rollup.config.ts @@ -1,5 +1,6 @@ -/* eslint-disable no-restricted-globals */ +import { readFileSync } from 'node:fs' import path from 'node:path' +import { fileURLToPath } from 'node:url' import nodeResolve from '@rollup/plugin-node-resolve' import typescript from '@rollup/plugin-typescript' import commonjs from '@rollup/plugin-commonjs' @@ -8,7 +9,12 @@ import MagicString from 'magic-string' import type { Plugin, RollupOptions } from 'rollup' import { defineConfig } from 'rollup' import licensePlugin from '../../scripts/rollupLicensePlugin.mjs' -import pkg from './package.json' + +const pkg = JSON.parse( + readFileSync(new URL('./package.json', import.meta.url)).toString() +) + +const __dirname = fileURLToPath(new URL('.', import.meta.url)) const envConfig = defineConfig({ input: path.resolve(__dirname, 'src/client/env.ts'), diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index fe147c1cd1b48d..79fe78a7c12dd1 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -28,6 +28,7 @@ import { buildReporterPlugin } from './plugins/reporter' import { buildEsbuildPlugin } from './plugins/esbuild' import { terserPlugin } from './plugins/terser' import { + asyncFlatten, copyDir, emptyDir, joinUrlSegments, @@ -383,15 +384,16 @@ export function resolveBuildOptions( return resolved } -export function resolveBuildPlugins(config: ResolvedConfig): { +export async function resolveBuildPlugins(config: ResolvedConfig): Promise<{ pre: Plugin[] post: Plugin[] -} { +}> { const options = config.build const { commonjsOptions } = options const usePluginCommonjs = !Array.isArray(commonjsOptions?.include) || commonjsOptions?.include.length !== 0 + const rollupOptionsPlugins = options.rollupOptions.plugins return { pre: [ completeSystemWrapPlugin(), @@ -399,9 +401,13 @@ export function resolveBuildPlugins(config: ResolvedConfig): { watchPackageDataPlugin(config), ...(usePluginCommonjs ? [commonjsPlugin(options.commonjsOptions)] : []), dataURIPlugin(), - ...(options.rollupOptions.plugins - ? (options.rollupOptions.plugins.filter(Boolean) as Plugin[]) - : []) + ...(( + await asyncFlatten( + Array.isArray(rollupOptionsPlugins) + ? rollupOptionsPlugins + : [rollupOptionsPlugins] + ) + ).filter(Boolean) as Plugin[]) ], post: [ buildImportAnalysisPlugin(config), @@ -827,12 +833,12 @@ export function onRollupWarning( config: ResolvedConfig ): void { if (warning.code === 'UNRESOLVED_IMPORT') { - const id = warning.source - const importer = warning.importer + const id = warning.id + const exporter = warning.exporter // throw unless it's commonjs external... - if (!importer || !/\?commonjs-external$/.test(importer)) { + if (!id || !/\?commonjs-external$/.test(id)) { throw new Error( - `[vite]: Rollup failed to resolve import "${id}" from "${importer}".\n` + + `[vite]: Rollup failed to resolve import "${exporter}" from "${id}".\n` + `This is most likely unintended because it can break your application at runtime.\n` + `If you do want to externalize this module explicitly add it to\n` + `\`build.rollupOptions.external\`` diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 0019cc0ddebe2a..ca87709cca3627 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -569,7 +569,10 @@ export async function resolveConfig( })) } return ( - await container.resolveId(id, importer, { ssr, scan: options?.scan }) + await container.resolveId(id, importer, { + ssr, + scan: options?.scan + }) )?.id } } diff --git a/packages/vite/src/node/constants.ts b/packages/vite/src/node/constants.ts index 35bf9231909850..e091afcebc928b 100644 --- a/packages/vite/src/node/constants.ts +++ b/packages/vite/src/node/constants.ts @@ -1,7 +1,10 @@ import path, { resolve } from 'node:path' import { fileURLToPath } from 'node:url' -// @ts-expect-error -import { version } from '../../package.json' +import { readFileSync } from 'node:fs' + +const { version } = JSON.parse( + readFileSync(new URL('../../package.json', import.meta.url)).toString() +) export const VERSION = version as string diff --git a/packages/vite/src/node/plugin.ts b/packages/vite/src/node/plugin.ts index b01cf6bda13be8..53c64c24ca1db9 100644 --- a/packages/vite/src/node/plugin.ts +++ b/packages/vite/src/node/plugin.ts @@ -146,6 +146,7 @@ export interface Plugin extends RollupPlugin { source: string, importer: string | undefined, options: { + assertions: Record custom?: CustomPluginOptions ssr?: boolean /** diff --git a/packages/vite/src/node/plugins/asset.ts b/packages/vite/src/node/plugins/asset.ts index 8a74736715bd9c..9bb5d7f7a42d84 100644 --- a/packages/vite/src/node/plugins/asset.ts +++ b/packages/vite/src/node/plugins/asset.ts @@ -494,8 +494,7 @@ async function fileToBuiltUrl( name, fileName: map.get(contentHash)!, type: 'asset', - source: content, - isAsset: true + source: content }) } diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 39b6844810f5fc..25d64b138e56f6 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -30,6 +30,7 @@ import { CLIENT_PUBLIC_PATH, SPECIAL_QUERY_RE } from '../constants' import type { ResolvedConfig } from '../config' import type { Plugin } from '../plugin' import { + arrayEqual, asyncReplace, cleanUrl, combineSourcemaps, @@ -305,7 +306,7 @@ export function cssPlugin(config: ResolvedConfig): Plugin { export function cssPostPlugin(config: ResolvedConfig): Plugin { // styles initialization in buildStart causes a styling loss in watch const styles: Map = new Map() - let pureCssChunks: Set + let pureCssChunks: Set // when there are multiple rollup outputs and extracting CSS, only emit once, // since output formats have no effect on the generated CSS. @@ -339,7 +340,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { buildStart() { // Ensure new caches for every build (i.e. rebuilding in watch mode) - pureCssChunks = new Set() + pureCssChunks = new Set() outputToExtractedCSSMap = new Map() hasEmitted = false }, @@ -537,7 +538,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { if (config.build.cssCodeSplit) { if (isPureCssChunk) { // this is a shared CSS-only chunk that is empty. - pureCssChunks.add(chunk.fileName) + pureCssChunks.add(chunk) } if (opts.format === 'es' || opts.format === 'cjs') { const cssAssetName = chunk.facadeModuleId @@ -624,7 +625,24 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { // remove empty css chunks and their imports if (pureCssChunks.size) { - const emptyChunkFiles = [...pureCssChunks] + // map each pure css chunk (rendered chunk) to it's corresponding bundle + // chunk. we check that by comparing the `moduleIds` as they have different + // filenames (rendered chunk has the !~{XXX}~ placeholder) + const pureCssChunkNames: string[] = [] + for (const pureCssChunk of pureCssChunks) { + for (const key in bundle) { + const bundleChunk = bundle[key] + if ( + bundleChunk.type === 'chunk' && + arrayEqual(bundleChunk.moduleIds, pureCssChunk.moduleIds) + ) { + pureCssChunkNames.push(key) + break + } + } + } + + const emptyChunkFiles = pureCssChunkNames .map((file) => path.basename(file)) .join('|') .replace(/\./g, '\\.') @@ -641,7 +659,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { // and also register the emitted CSS files under the importer // chunks instead. chunk.imports = chunk.imports.filter((file) => { - if (pureCssChunks.has(file)) { + if (pureCssChunkNames.includes(file)) { const { viteMetadata: { importedCss } } = bundle[file] as OutputChunk @@ -660,7 +678,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { } } const removedPureCssFiles = removedPureCssFilesCache.get(config)! - pureCssChunks.forEach((fileName) => { + pureCssChunkNames.forEach((fileName) => { removedPureCssFiles.set(fileName, bundle[fileName] as RenderedChunk) delete bundle[fileName] }) diff --git a/packages/vite/src/node/plugins/index.ts b/packages/vite/src/node/plugins/index.ts index 239f337704844c..057f4f1faa5271 100644 --- a/packages/vite/src/node/plugins/index.ts +++ b/packages/vite/src/node/plugins/index.ts @@ -35,7 +35,7 @@ export async function resolvePlugins( const isBuild = config.command === 'build' const isWatch = isBuild && !!config.build.watch const buildPlugins = isBuild - ? (await import('../build')).resolveBuildPlugins(config) + ? await (await import('../build')).resolveBuildPlugins(config) : { pre: [], post: [] } const { modulePreload } = config.build diff --git a/packages/vite/src/node/plugins/splitVendorChunk.ts b/packages/vite/src/node/plugins/splitVendorChunk.ts index bc319b01586dab..335a11bd6c3473 100644 --- a/packages/vite/src/node/plugins/splitVendorChunk.ts +++ b/packages/vite/src/node/plugins/splitVendorChunk.ts @@ -1,7 +1,7 @@ import type { GetManualChunk, - GetManualChunkApi, GetModuleInfo, + ManualChunkMeta, OutputOptions } from 'rollup' import type { UserConfig } from '../../node' @@ -106,7 +106,7 @@ export function splitVendorChunkPlugin(): Plugin { if (output.manualChunks) { if (typeof output.manualChunks === 'function') { const userManualChunks = output.manualChunks - output.manualChunks = (id: string, api: GetManualChunkApi) => { + output.manualChunks = (id: string, api: ManualChunkMeta) => { return userManualChunks(id, api) ?? viteManualChunks(id, api) } } diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index cd297d1e0826f2..ee333541105cbb 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -96,6 +96,7 @@ export interface PluginContainer { id: string, importer?: string, options?: { + assertions?: Record custom?: CustomPluginOptions skip?: Set ssr?: boolean @@ -295,6 +296,7 @@ export async function createPluginContainer( id: string, importer?: string, options?: { + assertions?: Record custom?: CustomPluginOptions isEntry?: boolean skipSelf?: boolean @@ -306,6 +308,7 @@ export async function createPluginContainer( skip.add(this._activePlugin) } let out = await container.resolveId(id, importer, { + assertions: options?.assertions, custom: options?.custom, isEntry: !!options?.isEntry, skip, @@ -587,6 +590,7 @@ export async function createPluginContainer( ? plugin.resolveId.handler : plugin.resolveId const result = await handler.call(ctx as any, rawId, importer, { + assertions: options?.assertions ?? {}, custom: options?.custom, isEntry: !!options?.isEntry, ssr, diff --git a/packages/vite/src/node/utils.ts b/packages/vite/src/node/utils.ts index f8aab87a13d96b..c0bc0646f58336 100644 --- a/packages/vite/src/node/utils.ts +++ b/packages/vite/src/node/utils.ts @@ -1205,3 +1205,12 @@ export function joinUrlSegments(a: string, b: string): string { } return a + b } + +export function arrayEqual(a: any[], b: any[]): boolean { + if (a === b) return true + if (a.length !== b.length) return false + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false + } + return true +} diff --git a/playground/vitestSetup.ts b/playground/vitestSetup.ts index cf476a87100c20..e768f898caf58e 100644 --- a/playground/vitestSetup.ts +++ b/playground/vitestSetup.ts @@ -306,7 +306,7 @@ export async function notifyRebuildComplete( await new Promise((resolve) => { resolveFn = resolve }) - return watcher.removeListener('event', callback) + return watcher.off('event', callback) } function createInMemoryLogger(logs: string[]): Logger { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 943570e2b192c1..f9ea33b33a84d5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,7 +53,7 @@ importers: prompts: ^2.4.2 resolve: ^1.22.1 rimraf: ^3.0.2 - rollup: ^2.79.1 + rollup: ~3.2.3 rollup-plugin-license: ^2.9.0 semver: ^7.3.8 simple-git-hooks: ^2.8.1 @@ -68,7 +68,7 @@ importers: devDependencies: '@babel/types': 7.20.0 '@microsoft/api-extractor': 7.33.5 - '@rollup/plugin-typescript': 8.5.0_emi2rsvbxv4qzobq57f3ztmpla + '@rollup/plugin-typescript': 8.5.0_hpj6ac2w2wubuhu2vpqucymlsi '@types/babel__core': 7.1.19 '@types/babel__standalone': 7.1.4 '@types/convert-source-map': 1.5.2 @@ -109,8 +109,8 @@ importers: prompts: 2.4.2 resolve: 1.22.1 rimraf: 3.0.2 - rollup: 2.79.1 - rollup-plugin-license: 2.9.0_rollup@2.79.1 + rollup: 3.2.3 + rollup-plugin-license: 2.9.0_rollup@3.2.3 semver: 7.3.8 simple-git-hooks: 2.8.1 tslib: 2.4.0 @@ -181,7 +181,7 @@ importers: '@jridgewell/gen-mapping': ^0.3.2 '@jridgewell/trace-mapping': ^0.3.17 debug: ^4.3.4 - rollup: ^2.79.1 + rollup: ~3.2.3 slash: ^5.0.0 source-map: ^0.6.1 vite: workspace:* @@ -190,7 +190,7 @@ importers: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.17 debug: 4.3.4 - rollup: 2.79.1 + rollup: 3.2.3 slash: 5.0.0 source-map: 0.6.1 vite: link:../vite @@ -259,7 +259,7 @@ importers: postcss-modules: ^5.0.0 resolve: ^1.22.1 resolve.exports: ^1.1.0 - rollup: ^2.79.1 + rollup: ~3.2.3 sirv: ^2.0.2 source-map-js: ^1.0.2 source-map-support: ^0.5.21 @@ -274,7 +274,7 @@ importers: esbuild: 0.15.9 postcss: 8.4.18 resolve: 1.22.1 - rollup: 2.79.1 + rollup: 3.2.3 optionalDependencies: fsevents: 2.3.2 devDependencies: @@ -282,12 +282,12 @@ importers: '@babel/parser': 7.20.0 '@babel/types': 7.20.0 '@jridgewell/trace-mapping': 0.3.17 - '@rollup/plugin-alias': 4.0.2_rollup@2.79.1 - '@rollup/plugin-commonjs': 23.0.2_rollup@2.79.1 - '@rollup/plugin-dynamic-import-vars': 2.0.1_rollup@2.79.1 - '@rollup/plugin-json': 4.1.0_rollup@2.79.1 - '@rollup/plugin-node-resolve': 14.1.0_rollup@2.79.1 - '@rollup/plugin-typescript': 8.5.0_rollup@2.79.1+tslib@2.4.0 + '@rollup/plugin-alias': 4.0.2_rollup@3.2.3 + '@rollup/plugin-commonjs': 23.0.2_rollup@3.2.3 + '@rollup/plugin-dynamic-import-vars': 2.0.1_rollup@3.2.3 + '@rollup/plugin-json': 4.1.0_rollup@3.2.3 + '@rollup/plugin-node-resolve': 14.1.0_rollup@3.2.3 + '@rollup/plugin-typescript': 8.5.0_rollup@3.2.3+tslib@2.4.0 '@rollup/pluginutils': 4.2.1 acorn: 8.8.1 cac: 6.7.14 @@ -2258,19 +2258,6 @@ packages: engines: {node: '>=14'} dev: false - /@rollup/plugin-alias/4.0.2_rollup@2.79.1: - resolution: {integrity: sha512-1hv7dBOZZwo3SEupxn4UA2N0EDThqSSS+wI1St1TNTBtOZvUchyIClyHcnDcjjrReTPZ47Faedrhblv4n+T5UQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - rollup: 2.79.1 - slash: 4.0.0 - dev: true - /@rollup/plugin-alias/4.0.2_rollup@3.2.3: resolution: {integrity: sha512-1hv7dBOZZwo3SEupxn4UA2N0EDThqSSS+wI1St1TNTBtOZvUchyIClyHcnDcjjrReTPZ47Faedrhblv4n+T5UQ==} engines: {node: '>=14.0.0'} @@ -2284,24 +2271,6 @@ packages: slash: 4.0.0 dev: true - /@rollup/plugin-commonjs/23.0.2_rollup@2.79.1: - resolution: {integrity: sha512-e9ThuiRf93YlVxc4qNIurvv+Hp9dnD+4PjOqQs5vAYfcZ3+AXSrcdzXnVjWxcGQOa6KGJFcRZyUI3ktWLavFjg==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.68.0||^3.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.1_rollup@2.79.1 - commondir: 1.0.1 - estree-walker: 2.0.2 - glob: 8.0.3 - is-reference: 1.2.1 - magic-string: 0.26.7 - rollup: 2.79.1 - dev: true - /@rollup/plugin-commonjs/23.0.2_rollup@3.2.3: resolution: {integrity: sha512-e9ThuiRf93YlVxc4qNIurvv+Hp9dnD+4PjOqQs5vAYfcZ3+AXSrcdzXnVjWxcGQOa6KGJFcRZyUI3ktWLavFjg==} engines: {node: '>=14.0.0'} @@ -2320,7 +2289,7 @@ packages: rollup: 3.2.3 dev: true - /@rollup/plugin-dynamic-import-vars/2.0.1_rollup@2.79.1: + /@rollup/plugin-dynamic-import-vars/2.0.1_rollup@3.2.3: resolution: {integrity: sha512-//rFVnJhZqR1Bje7n9ZMlmX9M62AExcLVXmbTcq80CqFx97C6CXaghLYsPzcZ7w8JhbVdjBIRADyLNel0HHorg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2329,20 +2298,20 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.1_rollup@2.79.1 + '@rollup/pluginutils': 5.0.1_rollup@3.2.3 estree-walker: 2.0.2 fast-glob: 3.2.12 magic-string: 0.26.7 - rollup: 2.79.1 + rollup: 3.2.3 dev: true - /@rollup/plugin-json/4.1.0_rollup@2.79.1: + /@rollup/plugin-json/4.1.0_rollup@3.2.3: resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} peerDependencies: rollup: ^1.20.0 || ^2.0.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 - rollup: 2.79.1 + '@rollup/pluginutils': 3.1.0_rollup@3.2.3 + rollup: 3.2.3 dev: true /@rollup/plugin-json/5.0.0_rollup@3.2.3: @@ -2358,19 +2327,19 @@ packages: rollup: 3.2.3 dev: true - /@rollup/plugin-node-resolve/14.1.0_rollup@2.79.1: + /@rollup/plugin-node-resolve/14.1.0_rollup@3.2.3: resolution: {integrity: sha512-5G2niJroNCz/1zqwXtk0t9+twOSDlG00k1Wfd7bkbbXmwg8H8dvgHdIWAun53Ps/rckfvOC7scDBjuGFg5OaWw==} engines: {node: '>= 10.0.0'} peerDependencies: rollup: ^2.78.0 dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 3.1.0_rollup@3.2.3 '@types/resolve': 1.17.1 deepmerge: 4.2.2 - is-builtin-module: 3.1.0 + is-builtin-module: 3.2.0 is-module: 1.0.0 resolve: 1.22.1 - rollup: 2.79.1 + rollup: 3.2.3 dev: true /@rollup/plugin-node-resolve/15.0.0_rollup@3.2.3: @@ -2405,7 +2374,7 @@ packages: rollup: 3.2.3 dev: true - /@rollup/plugin-typescript/8.5.0_emi2rsvbxv4qzobq57f3ztmpla: + /@rollup/plugin-typescript/8.5.0_hpj6ac2w2wubuhu2vpqucymlsi: resolution: {integrity: sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2416,14 +2385,14 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 3.1.0_rollup@3.2.3 resolve: 1.22.1 - rollup: 2.79.1 + rollup: 3.2.3 tslib: 2.4.0 typescript: 4.6.4 dev: true - /@rollup/plugin-typescript/8.5.0_rollup@2.79.1+tslib@2.4.0: + /@rollup/plugin-typescript/8.5.0_rollup@3.2.3+tslib@2.4.0: resolution: {integrity: sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==} engines: {node: '>=8.0.0'} peerDependencies: @@ -2434,13 +2403,13 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.79.1 + '@rollup/pluginutils': 3.1.0_rollup@3.2.3 resolve: 1.22.1 - rollup: 2.79.1 + rollup: 3.2.3 tslib: 2.4.0 dev: true - /@rollup/pluginutils/3.1.0_rollup@2.79.1: + /@rollup/pluginutils/3.1.0_rollup@3.2.3: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} peerDependencies: @@ -2449,7 +2418,7 @@ packages: '@types/estree': 0.0.39 estree-walker: 1.0.1 picomatch: 2.3.1 - rollup: 2.79.1 + rollup: 3.2.3 dev: true /@rollup/pluginutils/4.2.1: @@ -2460,21 +2429,6 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/pluginutils/5.0.1_rollup@2.79.1: - resolution: {integrity: sha512-4HaCVEXXuObvcPUaUlLt4faHYHCeQOOWNj8NKFGaRSrw3ZLD0TWeAFZicV9vXjnE2nkNuaVTfTuwAnjR+6uc9A==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@types/estree': 1.0.0 - estree-walker: 2.0.2 - picomatch: 2.3.1 - rollup: 2.79.1 - dev: true - /@rollup/pluginutils/5.0.1_rollup@3.2.3: resolution: {integrity: sha512-4HaCVEXXuObvcPUaUlLt4faHYHCeQOOWNj8NKFGaRSrw3ZLD0TWeAFZicV9vXjnE2nkNuaVTfTuwAnjR+6uc9A==} engines: {node: '>=14.0.0'} @@ -3350,11 +3304,6 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /builtin-modules/3.2.0: - resolution: {integrity: sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==} - engines: {node: '>=6'} - dev: true - /builtin-modules/3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -6122,13 +6071,6 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-builtin-module/3.1.0: - resolution: {integrity: sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==} - engines: {node: '>=6'} - dependencies: - builtin-modules: 3.2.0 - dev: true - /is-builtin-module/3.2.0: resolution: {integrity: sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==} engines: {node: '>=6'} @@ -8072,7 +8014,7 @@ packages: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-license/2.9.0_rollup@2.79.1: + /rollup-plugin-license/2.9.0_rollup@3.2.3: resolution: {integrity: sha512-mn3cUmTDtxm8FwYIP39w5R1PuIWqmVPOlvuNVTdfnT1+5R2t9LwBxuQXc5jv7tZQmW0/MM52uwTCZdp131EUtg==} engines: {node: '>=10.0.0'} peerDependencies: @@ -8085,25 +8027,17 @@ packages: mkdirp: 1.0.4 moment: 2.29.3 package-name-regex: 2.0.6 - rollup: 2.79.1 + rollup: 3.2.3 spdx-expression-validate: 2.0.0 spdx-satisfies: 5.0.1 dev: true - /rollup/2.79.1: - resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - /rollup/3.2.3: resolution: {integrity: sha512-qfadtkY5kl0F5e4dXVdj2D+GtOdifasXHFMiL1SMf9ADQDv5Eti6xReef9FKj+iQPR2pvtqWna57s/PjARY4fg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: fsevents: 2.3.2 - dev: true /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} diff --git a/scripts/rollupLicensePlugin.mjs b/scripts/rollupLicensePlugin.mjs index f96719e19bf9a6..1a3e242eae0160 100644 --- a/scripts/rollupLicensePlugin.mjs +++ b/scripts/rollupLicensePlugin.mjs @@ -5,7 +5,7 @@ import path from 'node:path' import license from 'rollup-plugin-license' import colors from 'picocolors' import fg from 'fast-glob' -import { sync as resolve } from 'resolve' +import resolve from 'resolve' /** * @param {string} licenseFilePath @@ -73,7 +73,7 @@ function licensePlugin(licenseFilePath, licenseTitle, packageName) { if (!licenseText && name) { try { const pkgDir = path.dirname( - resolve(path.join(name, 'package.json'), { + resolve.sync(path.join(name, 'package.json'), { preserveSymlinks: false }) )