diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db621689ef2639..c18ab498787d76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,8 @@ on: - perf/* - v1 - v2 + - v2.* + - v3.* pull_request: workflow_dispatch: diff --git a/packages/plugin-vue/CHANGELOG.md b/packages/plugin-vue/CHANGELOG.md index cde94520cdb190..d862f345e623ea 100644 --- a/packages/plugin-vue/CHANGELOG.md +++ b/packages/plugin-vue/CHANGELOG.md @@ -1,3 +1,16 @@ +## 3.1.2 (2022-10-02) + +* fix(esbuild): transpile with esnext in dev (#10207) ([abf2cfd](https://github.com/vitejs/vite/commit/abf2cfd)), closes [#10207](https://github.com/vitejs/vite/issues/10207) + + + +## 3.1.1 (2022-10-02) + +* fix(deps): update all non-major dependencies (#10077) ([caf00c8](https://github.com/vitejs/vite/commit/caf00c8)), closes [#10077](https://github.com/vitejs/vite/issues/10077) +* fix(deps): update all non-major dependencies (#9985) ([855f2f0](https://github.com/vitejs/vite/commit/855f2f0)), closes [#9985](https://github.com/vitejs/vite/issues/9985) + + + ## 3.1.0 (2022-09-05) diff --git a/packages/plugin-vue/package.json b/packages/plugin-vue/package.json index af9671eb3373b6..e2f410ec438221 100644 --- a/packages/plugin-vue/package.json +++ b/packages/plugin-vue/package.json @@ -1,6 +1,6 @@ { "name": "@vitejs/plugin-vue", - "version": "3.1.0", + "version": "3.1.2", "license": "MIT", "author": "Evan You", "files": [ diff --git a/packages/plugin-vue/src/main.ts b/packages/plugin-vue/src/main.ts index bdb846ab4abcfd..5d76256f75c2c2 100644 --- a/packages/plugin-vue/src/main.ts +++ b/packages/plugin-vue/src/main.ts @@ -221,7 +221,11 @@ export async function transformMain( const { code, map } = await transformWithEsbuild( resolvedCode, filename, - { loader: 'ts', sourcemap: options.sourceMap }, + { + loader: 'ts', + target: 'esnext', + sourcemap: options.sourceMap + }, resolvedMap ) resolvedCode = code diff --git a/packages/vite/CHANGELOG.md b/packages/vite/CHANGELOG.md index 7c5b918f653f1b..8f6edef5467ddc 100644 --- a/packages/vite/CHANGELOG.md +++ b/packages/vite/CHANGELOG.md @@ -1,3 +1,15 @@ +## 3.1.5 (2022-10-06) + +* fix(build): fix resolution algorithm when `build.ssr` is true (#9989) ([f20d285](https://github.com/vitejs/vite/commit/f20d285)), closes [#9989](https://github.com/vitejs/vite/issues/9989) +* fix(config): resolve implicit deps as absolute path (#10254) ([dc140af](https://github.com/vitejs/vite/commit/dc140af)), closes [#10254](https://github.com/vitejs/vite/issues/10254) +* fix(css): missing css in lib mode (#10185) ([e2cdb28](https://github.com/vitejs/vite/commit/e2cdb28)), closes [#10185](https://github.com/vitejs/vite/issues/10185) +* fix(esbuild): transpile with esnext in dev (#10207) ([abf2cfd](https://github.com/vitejs/vite/commit/abf2cfd)), closes [#10207](https://github.com/vitejs/vite/issues/10207) +* fix(hmr): handle virtual module update (#10324) ([14ebbc6](https://github.com/vitejs/vite/commit/14ebbc6)), closes [#10324](https://github.com/vitejs/vite/issues/10324) +* fix(ssr): correctly track scope (#10300) ([effb7c3](https://github.com/vitejs/vite/commit/effb7c3)), closes [#10300](https://github.com/vitejs/vite/issues/10300) +* chore: fix build error ([01aa224](https://github.com/vitejs/vite/commit/01aa224)) + + + ## 3.1.4 (2022-09-28) * fix(esbuild): transpile with esnext in dev (#10215) ([4a0f210](https://github.com/vitejs/vite/commit/4a0f210)), closes [#10215](https://github.com/vitejs/vite/issues/10215) diff --git a/packages/vite/package.json b/packages/vite/package.json index fd566d1610272f..f6b943588ced63 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "vite", - "version": "3.1.4", + "version": "3.1.5", "type": "module", "license": "MIT", "author": "Evan You", @@ -58,7 +58,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "esbuild": "^0.15.6", + "esbuild": "^0.15.9", "postcss": "^8.4.16", "resolve": "^1.22.1", "rollup": "~2.78.0" diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 829c47fee07abf..2b2b9089e4eb16 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -43,10 +43,12 @@ import { CLIENT_ENTRY, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, + DEFAULT_EXTENSIONS, + DEFAULT_MAIN_FIELDS, ENV_ENTRY } from './constants' import type { InternalResolveOptions, ResolveOptions } from './plugins/resolve' -import { resolvePlugin } from './plugins/resolve' +import { resolvePlugin, tryNodeResolve } from './plugins/resolve' import type { LogLevel, Logger } from './logger' import { createLogger } from './logger' import type { DepOptimizationConfig, DepOptimizationOptions } from './optimizer' @@ -955,40 +957,32 @@ async function bundleConfigFile( { name: 'externalize-deps', setup(build) { - build.onResolve({ filter: /.*/ }, ({ path: id, importer }) => { + const options: InternalResolveOptions = { + root: path.dirname(fileName), + isBuild: true, + isProduction: true, + isRequire: !isESM, + preferRelative: false, + tryIndex: true, + mainFields: DEFAULT_MAIN_FIELDS, + conditions: [], + dedupe: [], + extensions: DEFAULT_EXTENSIONS, + preserveSymlinks: false + } + + build.onResolve({ filter: /.*/ }, ({ path: id, importer, kind }) => { // externalize bare imports - if (id[0] !== '.' && !path.isAbsolute(id)) { + if (id[0] !== '.' && !isAbsolute(id)) { + let idFsPath = tryNodeResolve(id, importer, options, false)?.id + if (idFsPath && (isESM || kind === 'dynamic-import')) { + idFsPath = pathToFileURL(idFsPath).href + } return { + path: idFsPath, external: true } } - // bundle the rest and make sure that the we can also access - // it's third-party dependencies. externalize if not. - // monorepo/ - // ├─ package.json - // ├─ utils.js -----------> bundle (share same node_modules) - // ├─ vite-project/ - // │ ├─ vite.config.js --> entry - // │ ├─ package.json - // ├─ foo-project/ - // │ ├─ utils.js --------> external (has own node_modules) - // │ ├─ package.json - const idFsPath = path.resolve(path.dirname(importer), id) - const idPkgPath = lookupFile(idFsPath, [`package.json`], { - pathOnly: true - }) - if (idPkgPath) { - const idPkgDir = path.dirname(idPkgPath) - // if this file needs to go up one or more directory to reach the vite config, - // that means it has it's own node_modules (e.g. foo-project) - if (path.relative(idPkgDir, fileName).startsWith('..')) { - return { - // normalize actual import after bundled as a single vite config - path: isESM ? pathToFileURL(idFsPath).href : idFsPath, - external: true - } - } - } }) } }, @@ -1110,3 +1104,7 @@ export function isDepsOptimizerEnabled( (command === 'serve' && disabled === 'dev') ) } + +function isAbsolute(id: string) { + return path.isAbsolute(id) || path.posix.isAbsolute(id) +} diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index aebb3286584662..19cfcb2d0188f4 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -563,7 +563,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { // the legacy build should avoid inserting entry CSS modules here, they // will be collected into `chunk.viteMetadata.importedCss` and injected // later by the `'vite:build-html'` plugin into the `index.html` - if (chunk.isEntry) { + if (chunk.isEntry && !config.build.lib) { return null } chunkCSS = await finalizeCss(chunkCSS, true, config) diff --git a/packages/vite/src/node/plugins/importAnalysis.ts b/packages/vite/src/node/plugins/importAnalysis.ts index 86bad0b75ac001..3014a416a52e8a 100644 --- a/packages/vite/src/node/plugins/importAnalysis.ts +++ b/packages/vite/src/node/plugins/importAnalysis.ts @@ -21,7 +21,8 @@ import { debugHmr, handlePrunedModules, lexAcceptedHmrDeps, - lexAcceptedHmrExports + lexAcceptedHmrExports, + normalizeHmrUrl } from '../server/hmr' import { cleanUrl, @@ -629,7 +630,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { str().prepend( `import { createHotContext as __vite__createHotContext } from "${clientPublicPath}";` + `import.meta.hot = __vite__createHotContext(${JSON.stringify( - importerModule.url + normalizeHmrUrl(importerModule.url) )});` ) } diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 2f2ccb2fb9af96..6ad8ecfe645d83 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -721,7 +721,11 @@ export function tryNodeResolve( let resolvedId = id if (isDeepImport) { if (!pkg?.data.exports && path.extname(id) !== resolvedExt) { - resolvedId += resolvedExt + resolvedId = resolved.id.slice(resolved.id.indexOf(id)) + isDebug && + debug( + `[processResult] ${colors.cyan(id)} -> ${colors.dim(resolvedId)}` + ) } } return { ...resolved, id: resolvedId, external: true } diff --git a/packages/vite/src/node/server/hmr.ts b/packages/vite/src/node/server/hmr.ts index 3493d370ab0b65..e5d93fad8629de 100644 --- a/packages/vite/src/node/server/hmr.ts +++ b/packages/vite/src/node/server/hmr.ts @@ -5,7 +5,7 @@ import colors from 'picocolors' import type { Update } from 'types/hmrPayload' import type { RollupError } from 'rollup' import { CLIENT_DIR } from '../constants' -import { createDebugger, normalizePath, unique } from '../utils' +import { createDebugger, normalizePath, unique, wrapId } from '../utils' import type { ViteDevServer } from '..' import { isCSSRequest } from '../plugins/css' import { getAffectedGlobModules } from '../plugins/importMetaGlob' @@ -154,12 +154,12 @@ export function updateModules( ...[...boundaries].map(({ boundary, acceptedVia }) => ({ type: `${boundary.type}-update` as const, timestamp, - path: boundary.url, + path: normalizeHmrUrl(boundary.url), explicitImportRequired: boundary.type === 'js' ? isExplicitImportRequired(acceptedVia.url) : undefined, - acceptedPath: acceptedVia.url + acceptedPath: normalizeHmrUrl(acceptedVia.url) })) ) } @@ -484,6 +484,13 @@ export function lexAcceptedHmrExports( return urls.size > 0 } +export function normalizeHmrUrl(url: string): string { + if (!url.startsWith('.') && !url.startsWith('/')) { + url = wrapId(url) + } + return url +} + function error(pos: number) { const err = new Error( `import.meta.hot.accept() can only accept string literals or an ` + diff --git a/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts b/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts index e70a3e30c948cc..a5ca20c9be3d09 100644 --- a/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts +++ b/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts @@ -1,6 +1,5 @@ import { expect, test } from 'vitest' import { transformWithEsbuild } from '../../plugins/esbuild' -import { traverseHtml } from '../../plugins/html' import { ssrTransform } from '../ssrTransform' const ssrTransformSimple = async (code: string, url = '') => @@ -728,3 +727,63 @@ console.log("it can parse the hashbang")` console.log(\\"it can parse the hashbang\\")" `) }) + +// #10289 +test('track scope by class, function, condition blocks', async () => { + const code = ` +import { foo, bar } from 'foobar' +if (false) { + const foo = 'foo' + console.log(foo) +} else if (false) { + const [bar] = ['bar'] + console.log(bar) +} else { + console.log(foo) + console.log(bar) +} +export class Test { + constructor() { + if (false) { + const foo = 'foo' + console.log(foo) + } else if (false) { + const [bar] = ['bar'] + console.log(bar) + } else { + console.log(foo) + console.log(bar) + } + } +};`.trim() + + expect(await ssrTransformSimpleCode(code)).toMatchInlineSnapshot(` + "const __vite_ssr_import_0__ = await __vite_ssr_import__(\\"foobar\\"); + + if (false) { + const foo = 'foo' + console.log(foo) + } else if (false) { + const [bar] = ['bar'] + console.log(bar) + } else { + console.log(__vite_ssr_import_0__.foo) + console.log(__vite_ssr_import_0__.bar) + } + class Test { + constructor() { + if (false) { + const foo = 'foo' + console.log(foo) + } else if (false) { + const [bar] = ['bar'] + console.log(bar) + } else { + console.log(__vite_ssr_import_0__.foo) + console.log(__vite_ssr_import_0__.bar) + } + } + } + Object.defineProperty(__vite_ssr_exports__, \\"Test\\", { enumerable: true, configurable: true, get(){ return Test }});;" + `) +}) diff --git a/packages/vite/src/node/ssr/ssrTransform.ts b/packages/vite/src/node/ssr/ssrTransform.ts index 0798d674547fb3..fe24dddac2e79a 100644 --- a/packages/vite/src/node/ssr/ssrTransform.ts +++ b/packages/vite/src/node/ssr/ssrTransform.ts @@ -322,7 +322,7 @@ function walk( const scopeMap = new WeakMap<_Node, Set>() const identifiers: [id: any, stack: Node[]][] = [] - const setScope = (node: FunctionNode, name: string) => { + const setScope = (node: _Node, name: string) => { let scopeIds = scopeMap.get(node) if (scopeIds && scopeIds.has(name)) { return @@ -337,29 +337,29 @@ function walk( function isInScope(name: string, parents: Node[]) { return parents.some((node) => node && scopeMap.get(node)?.has(name)) } - function handlePattern(p: Pattern, parentFunction: FunctionNode) { + function handlePattern(p: Pattern, parentScope: _Node) { if (p.type === 'Identifier') { - setScope(parentFunction, p.name) + setScope(parentScope, p.name) } else if (p.type === 'RestElement') { - handlePattern(p.argument, parentFunction) + handlePattern(p.argument, parentScope) } else if (p.type === 'ObjectPattern') { p.properties.forEach((property) => { if (property.type === 'RestElement') { - setScope(parentFunction, (property.argument as Identifier).name) + setScope(parentScope, (property.argument as Identifier).name) } else { - handlePattern(property.value, parentFunction) + handlePattern(property.value, parentScope) } }) } else if (p.type === 'ArrayPattern') { p.elements.forEach((element) => { if (element) { - handlePattern(element, parentFunction) + handlePattern(element, parentScope) } }) } else if (p.type === 'AssignmentPattern') { - handlePattern(p.left, parentFunction) + handlePattern(p.left, parentScope) } else { - setScope(parentFunction, (p as any).name) + setScope(parentScope, (p as any).name) } } @@ -369,7 +369,14 @@ function walk( return this.skip() } - parent && parentStack.unshift(parent) + // track parent stack, skip for "else-if"/"else" branches as acorn nests + // the ast within "if" nodes instead of flattening them + if ( + parent && + !(parent.type === 'IfStatement' && node === parent.alternate) + ) { + parentStack.unshift(parent) + } if (node.type === 'MetaProperty' && node.meta.name === 'import') { onImportMeta(node) @@ -389,9 +396,9 @@ function walk( // If it is a function declaration, it could be shadowing an import // Add its name to the scope so it won't get replaced if (node.type === 'FunctionDeclaration') { - const parentFunction = findParentFunction(parentStack) - if (parentFunction) { - setScope(parentFunction, node.id!.name) + const parentScope = findParentScope(parentStack) + if (parentScope) { + setScope(parentScope, node.id!.name) } } // walk function expressions and add its arguments to known identifiers @@ -430,7 +437,7 @@ function walk( // mark property in destructuring pattern setIsNodeInPattern(node) } else if (node.type === 'VariableDeclarator') { - const parentFunction = findParentFunction(parentStack) + const parentFunction = findParentScope(parentStack) if (parentFunction) { handlePattern(node.id, parentFunction) } @@ -438,7 +445,13 @@ function walk( }, leave(node: Node, parent: Node | null) { - parent && parentStack.shift() + // untrack parent stack from above + if ( + parent && + !(parent.type === 'IfStatement' && node === parent.alternate) + ) { + parentStack.shift() + } } }) @@ -521,12 +534,15 @@ const isStaticProperty = (node: _Node): node is Property => const isStaticPropertyKey = (node: _Node, parent: _Node) => isStaticProperty(parent) && parent.key === node +const functionNodeTypeRE = /Function(?:Expression|Declaration)$|Method$/ function isFunction(node: _Node): node is FunctionNode { - return /Function(?:Expression|Declaration)$|Method$/.test(node.type) + return functionNodeTypeRE.test(node.type) } -function findParentFunction(parentStack: _Node[]): FunctionNode | undefined { - return parentStack.find((i) => isFunction(i)) as FunctionNode +const scopeNodeTypeRE = + /(?:Function|Class)(?:Expression|Declaration)$|Method$|^IfStatement$/ +function findParentScope(parentStack: _Node[]): _Node | undefined { + return parentStack.find((i) => scopeNodeTypeRE.test(i.type)) } function isInDestructuringAssignment( diff --git a/playground/config/__tests__/load.spec.ts b/playground/config/__tests__/load.spec.ts new file mode 100644 index 00000000000000..e25ac224673a66 --- /dev/null +++ b/playground/config/__tests__/load.spec.ts @@ -0,0 +1,24 @@ +import { resolve } from 'node:path' +import { loadConfigFromFile } from 'vite' +import { expect, it } from 'vitest' + +it('loadConfigFromFile', async () => { + const { config } = await loadConfigFromFile( + {} as any, + resolve(__dirname, '../packages/entry/vite.config.ts') + ) + expect(config).toMatchInlineSnapshot(` + { + "array": [ + [ + 1, + 3, + ], + [ + 2, + 4, + ], + ], + } + `) +}) diff --git a/playground/config/__tests__/serve.ts b/playground/config/__tests__/serve.ts new file mode 100644 index 00000000000000..e8959c0a1eda19 --- /dev/null +++ b/playground/config/__tests__/serve.ts @@ -0,0 +1,3 @@ +export function serve() { + return +} diff --git a/playground/config/packages/entry/package.json b/playground/config/packages/entry/package.json new file mode 100644 index 00000000000000..c251a034716150 --- /dev/null +++ b/playground/config/packages/entry/package.json @@ -0,0 +1,3 @@ +{ + "name": "@vite/test-config-entry" +} diff --git a/playground/config/packages/entry/vite.config.ts b/playground/config/packages/entry/vite.config.ts new file mode 100644 index 00000000000000..a53828cb84cfd8 --- /dev/null +++ b/playground/config/packages/entry/vite.config.ts @@ -0,0 +1,5 @@ +import { array } from '../siblings/foo' + +export default { + array +} diff --git a/playground/config/packages/siblings/foo.ts b/playground/config/packages/siblings/foo.ts new file mode 100644 index 00000000000000..78a8912131faed --- /dev/null +++ b/playground/config/packages/siblings/foo.ts @@ -0,0 +1,3 @@ +import { partition } from 'lodash' + +export const array = partition([1, 2, 3, 4], (n) => n % 2) diff --git a/playground/config/packages/siblings/package.json b/playground/config/packages/siblings/package.json new file mode 100644 index 00000000000000..4cbdc81d2100ea --- /dev/null +++ b/playground/config/packages/siblings/package.json @@ -0,0 +1,7 @@ +{ + "name": "@vite/test-config-sibling", + "devDependencies": { + "@types/lodash": "^4.14.186", + "lodash": "^4.17.21" + } +} diff --git a/playground/ssr-resolve/__tests__/ssr-resolve.spec.ts b/playground/ssr-resolve/__tests__/ssr-resolve.spec.ts new file mode 100644 index 00000000000000..a560173281ebe6 --- /dev/null +++ b/playground/ssr-resolve/__tests__/ssr-resolve.spec.ts @@ -0,0 +1,13 @@ +import { expect, test } from 'vitest' +import { isBuild, readFile, testDir } from '~utils' + +test.runIf(isBuild)('correctly resolve entrypoints', async () => { + const contents = readFile('dist/main.mjs') + + const _ = `['"]` + expect(contents).toMatch(new RegExp(`from ${_}entries/dir/index.js${_}`)) + expect(contents).toMatch(new RegExp(`from ${_}entries/file.js${_}`)) + expect(contents).toMatch(new RegExp(`from ${_}pkg-exports/entry${_}`)) + + await expect(import(`${testDir}/dist/main.mjs`)).resolves.toBeTruthy() +}) diff --git a/playground/ssr-resolve/entries/dir/index.js b/playground/ssr-resolve/entries/dir/index.js new file mode 100644 index 00000000000000..29a5acb7305fc0 --- /dev/null +++ b/playground/ssr-resolve/entries/dir/index.js @@ -0,0 +1 @@ +module.exports = __filename.slice(__filename.lastIndexOf('entries')) diff --git a/playground/ssr-resolve/entries/file.js b/playground/ssr-resolve/entries/file.js new file mode 100644 index 00000000000000..29a5acb7305fc0 --- /dev/null +++ b/playground/ssr-resolve/entries/file.js @@ -0,0 +1 @@ +module.exports = __filename.slice(__filename.lastIndexOf('entries')) diff --git a/playground/ssr-resolve/entries/package.json b/playground/ssr-resolve/entries/package.json new file mode 100644 index 00000000000000..2e6761d4a6b63c --- /dev/null +++ b/playground/ssr-resolve/entries/package.json @@ -0,0 +1,5 @@ +{ + "name": "entries", + "private": true, + "version": "0.0.0" +} diff --git a/playground/ssr-resolve/main.js b/playground/ssr-resolve/main.js new file mode 100644 index 00000000000000..c6ba016ebd6ad5 --- /dev/null +++ b/playground/ssr-resolve/main.js @@ -0,0 +1,12 @@ +// no `exports` key, should resolve to entries/dir/index.js +import dirEntry from 'entries/dir' +// no `exports` key, should resolve to entries/file.js +import fileEntry from 'entries/file' +// has `exports` key, should resolve to pkg-exports/entry +import pkgExportsEntry from 'pkg-exports/entry' + +export default ` + entries/dir: ${dirEntry} + entries/file: ${fileEntry} + pkg-exports/entry: ${pkgExportsEntry} +` diff --git a/playground/ssr-resolve/package.json b/playground/ssr-resolve/package.json new file mode 100644 index 00000000000000..f022293b5b4f08 --- /dev/null +++ b/playground/ssr-resolve/package.json @@ -0,0 +1,13 @@ +{ + "name": "ssr-resolve", + "private": true, + "version": "0.0.0", + "scripts": { + "build": "vite build", + "debug": "node --inspect-brk ../../packages/vite/bin/vite build" + }, + "dependencies": { + "entries": "file:./entries", + "pkg-exports": "file:./pkg-exports" + } +} diff --git a/playground/ssr-resolve/pkg-exports/entry.js b/playground/ssr-resolve/pkg-exports/entry.js new file mode 100644 index 00000000000000..880189c611bf02 --- /dev/null +++ b/playground/ssr-resolve/pkg-exports/entry.js @@ -0,0 +1 @@ +module.exports = 'pkg-exports entry' diff --git a/playground/ssr-resolve/pkg-exports/index.js b/playground/ssr-resolve/pkg-exports/index.js new file mode 100644 index 00000000000000..c5f2ccf114fb46 --- /dev/null +++ b/playground/ssr-resolve/pkg-exports/index.js @@ -0,0 +1 @@ +module.exports = undefined diff --git a/playground/ssr-resolve/pkg-exports/package.json b/playground/ssr-resolve/pkg-exports/package.json new file mode 100644 index 00000000000000..227450812e416c --- /dev/null +++ b/playground/ssr-resolve/pkg-exports/package.json @@ -0,0 +1,9 @@ +{ + "name": "pkg-exports", + "private": true, + "version": "0.0.0", + "exports": { + ".": "./index.js", + "./entry": "./entry.js" + } +} diff --git a/playground/ssr-resolve/vite.config.js b/playground/ssr-resolve/vite.config.js new file mode 100644 index 00000000000000..430c2331977703 --- /dev/null +++ b/playground/ssr-resolve/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' + +export default defineConfig({ + build: { + ssr: './main.js' + } +}) diff --git a/playground/vue-lib/__tests__/vue-lib.spec.ts b/playground/vue-lib/__tests__/vue-lib.spec.ts index 64f318656ca10e..50b554d63f9f76 100644 --- a/playground/vue-lib/__tests__/vue-lib.spec.ts +++ b/playground/vue-lib/__tests__/vue-lib.spec.ts @@ -22,4 +22,15 @@ describe('vue component library', () => { expect(code).toContain('styleA') // styleA is used by CompA expect(code).not.toContain('styleB') // styleB is not used }) + + test('should inject css when cssCodeSplit = true', async () => { + // Build lib + const { output } = ( + await build({ + logLevel: 'silent', + configFile: path.resolve(__dirname, '../vite.config.lib-css.ts') + }) + )[0] + expect(output[0].code).toContain('.card{padding:4rem}') + }) }) diff --git a/playground/vue-lib/package.json b/playground/vue-lib/package.json index d59f3d626160d4..d28ab18295c799 100644 --- a/playground/vue-lib/package.json +++ b/playground/vue-lib/package.json @@ -5,6 +5,7 @@ "scripts": { "dev-consumer": "vite --config ./vite.config.consumer.ts", "build-lib": "vite build --config ./vite.config.lib.ts", + "build-lib-css": "vite build --config ./vite.config.lib-css.ts", "build-consumer": "vite build --config ./vite.config.consumer.ts" }, "dependencies": { diff --git a/playground/vue-lib/src-lib-css/index.css b/playground/vue-lib/src-lib-css/index.css new file mode 100644 index 00000000000000..135f4787b30766 --- /dev/null +++ b/playground/vue-lib/src-lib-css/index.css @@ -0,0 +1,3 @@ +.card { + padding: 4rem; +} diff --git a/playground/vue-lib/src-lib-css/index.ts b/playground/vue-lib/src-lib-css/index.ts new file mode 100644 index 00000000000000..0da52ebb0b6115 --- /dev/null +++ b/playground/vue-lib/src-lib-css/index.ts @@ -0,0 +1,3 @@ +import './index.css' + +export function setup() {} diff --git a/playground/vue-lib/vite.config.lib-css.ts b/playground/vue-lib/vite.config.lib-css.ts new file mode 100644 index 00000000000000..e20ec925e05b0e --- /dev/null +++ b/playground/vue-lib/vite.config.lib-css.ts @@ -0,0 +1,16 @@ +import path from 'node:path' +import { defineConfig } from 'vite' + +export default defineConfig({ + root: __dirname, + build: { + outDir: 'dist/lib', + cssCodeSplit: true, + lib: { + entry: path.resolve(__dirname, 'src-lib-css/index.ts'), + name: 'index', + formats: ['umd'], + fileName: 'index.js' + } + } +}) diff --git a/playground/vue/tsconfig.json b/playground/vue/tsconfig.json new file mode 100644 index 00000000000000..5f90cb166d696b --- /dev/null +++ b/playground/vue/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + // esbuild transpile should ignore this + "target": "ES5" + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 837648b0bc6362..49d74c12e38abb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -234,7 +234,7 @@ importers: dotenv: ^14.3.2 dotenv-expand: ^5.1.0 es-module-lexer: ^1.0.3 - esbuild: ^0.15.6 + esbuild: ^0.15.9 estree-walker: ^3.0.1 etag: ^1.8.1 fast-glob: ^3.2.12 @@ -269,7 +269,7 @@ importers: ufo: ^0.8.5 ws: ^8.8.1 dependencies: - esbuild: 0.15.6 + esbuild: 0.15.9 postcss: 8.4.16 resolve: 1.22.1 rollup: 2.78.0 @@ -384,6 +384,17 @@ importers: playground/cli-module: specifiers: {} + playground/config/packages/entry: + specifiers: {} + + playground/config/packages/siblings: + specifiers: + '@types/lodash': ^4.14.186 + lodash: ^4.17.21 + devDependencies: + '@types/lodash': 4.14.186 + lodash: 4.17.21 + playground/css: specifiers: css-dep: link:./css-dep @@ -1085,6 +1096,20 @@ importers: express: 4.18.1 serve-static: 1.15.0 + playground/ssr-resolve: + specifiers: + entries: file:./entries + pkg-exports: file:./pkg-exports + dependencies: + entries: file:playground/ssr-resolve/entries + pkg-exports: file:playground/ssr-resolve/pkg-exports + + playground/ssr-resolve/entries: + specifiers: {} + + playground/ssr-resolve/pkg-exports: + specifiers: {} + playground/ssr-vue: specifiers: '@vitejs/plugin-vue': workspace:* @@ -1938,8 +1963,16 @@ packages: get-tsconfig: 4.1.0 dev: true - /@esbuild/linux-loong64/0.15.6: - resolution: {integrity: sha512-hqmVU2mUjH6J2ZivHphJ/Pdse2ZD+uGCHK0uvsiLDk/JnSedEVj77CiVUnbMKuU4tih1TZZL8tG9DExQg/GZsw==} + /@esbuild/android-arm/0.15.9: + resolution: {integrity: sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + optional: true + + /@esbuild/linux-loong64/0.15.9: + resolution: {integrity: sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -2499,6 +2532,10 @@ packages: resolution: {integrity: sha512-1YXyYH83h6We1djyoUEqTlVyQtCfJAFXELSKW2ZRtjHD4hQ82CC4lvrv5D0l0FLcKBaiPbXyi3MpMsI9ZRgKsw==} dev: true + /@types/lodash/4.14.186: + resolution: {integrity: sha512-eHcVlLXP0c2FlMPm56ITode2AgLMSa6aJ05JTTbYbI+7EMkCEE5qk2E41d5g2lCVTqRe0GnnRFurmlCsDODrPw==} + dev: true + /@types/micromatch/4.0.2: resolution: {integrity: sha512-oqXqVb0ci19GtH0vOA/U2TmHTcRY9kuZl4mqUxe0QmJAlIW13kzhuK5pi1i9+ngav8FjpSb9FVS/GE00GLX1VA==} dependencies: @@ -4150,8 +4187,8 @@ packages: dev: true optional: true - /esbuild-android-64/0.15.6: - resolution: {integrity: sha512-Z1CHSgB1crVQi2LKSBwSkpaGtaloVz0ZIYcRMsvHc3uSXcR/x5/bv9wcZspvH/25lIGTaViosciS/NS09ERmVA==} + /esbuild-android-64/0.15.9: + resolution: {integrity: sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -4176,8 +4213,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.15.6: - resolution: {integrity: sha512-mvM+gqNxqKm2pCa3dnjdRzl7gIowuc4ga7P7c3yHzs58Im8v/Lfk1ixSgQ2USgIywT48QWaACRa3F4MG7djpSw==} + /esbuild-android-arm64/0.15.9: + resolution: {integrity: sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -4202,8 +4239,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.15.6: - resolution: {integrity: sha512-BsfVt3usScAfGlXJiGtGamwVEOTM8AiYiw1zqDWhGv6BncLXCnTg1As+90mxWewdTZKq3iIy8s9g8CKkrrAXVw==} + /esbuild-darwin-64/0.15.9: + resolution: {integrity: sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -4228,8 +4265,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.15.6: - resolution: {integrity: sha512-CnrAeJaEpPakUobhqO4wVSA4Zm6TPaI5UY4EsI62j9mTrjIyQPXA1n4Ju6Iu5TVZRnEqV6q8blodgYJ6CJuwCA==} + /esbuild-darwin-arm64/0.15.9: + resolution: {integrity: sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -4254,8 +4291,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.15.6: - resolution: {integrity: sha512-+qFdmqi+jkAsxsNJkaWVrnxEUUI50nu6c3MBVarv3RCDCbz7ZS1a4ZrdkwEYFnKcVWu6UUE0Kkb1SQ1yGEG6sg==} + /esbuild-freebsd-64/0.15.9: + resolution: {integrity: sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -4280,8 +4317,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.15.6: - resolution: {integrity: sha512-KtQkQOhnNciXm2yrTYZMD3MOm2zBiiwFSU+dkwNbcfDumzzUprr1x70ClTdGuZwieBS1BM/k0KajRQX7r504Xw==} + /esbuild-freebsd-arm64/0.15.9: + resolution: {integrity: sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -4306,8 +4343,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.15.6: - resolution: {integrity: sha512-IAkDNz3TpxwISTGVdQijwyHBZrbFgLlRi5YXcvaEHtgbmayLSDcJmH5nV1MFgo/x2QdKcHBkOYHdjhKxUAcPwg==} + /esbuild-linux-32/0.15.9: + resolution: {integrity: sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -4332,8 +4369,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.15.6: - resolution: {integrity: sha512-gQPksyrEYfA4LJwyfTQWAZaVZCx4wpaLrSzo2+Xc9QLC+i/sMWmX31jBjrn4nLJCd79KvwCinto36QC7BEIU/A==} + /esbuild-linux-64/0.15.9: + resolution: {integrity: sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -4358,8 +4395,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.15.6: - resolution: {integrity: sha512-xZ0Bq2aivsthDjA/ytQZzxrxIZbG0ATJYMJxNeOIBc1zUjpbVpzBKgllOZMsTSXMHFHGrow6TnCcgwqY0+oEoQ==} + /esbuild-linux-arm/0.15.9: + resolution: {integrity: sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -4384,8 +4421,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.15.6: - resolution: {integrity: sha512-aovDkclFa6C9EdZVBuOXxqZx83fuoq8097xZKhEPSygwuy4Lxs8J4anHG7kojAsR+31lfUuxzOo2tHxv7EiNHA==} + /esbuild-linux-arm64/0.15.9: + resolution: {integrity: sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -4410,8 +4447,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.15.6: - resolution: {integrity: sha512-wVpW8wkWOGizsCqCwOR/G3SHwhaecpGy3fic9BF1r7vq4djLjUcA8KunDaBCjJ6TgLQFhJ98RjDuyEf8AGjAvw==} + /esbuild-linux-mips64le/0.15.9: + resolution: {integrity: sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -4436,8 +4473,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.15.6: - resolution: {integrity: sha512-z6w6gsPH/Y77uchocluDC8tkCg9rfkcPTePzZKNr879bF4tu7j9t255wuNOCE396IYEGxY7y8u2HJ9i7kjCLVw==} + /esbuild-linux-ppc64le/0.15.9: + resolution: {integrity: sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -4462,8 +4499,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.15.6: - resolution: {integrity: sha512-pfK/3MJcmbfU399TnXW5RTPS1S+ID6ra+CVj9TFZ2s0q9Ja1F5A1VirUUvViPkjiw+Kq3zveyn6U09Wg1zJXrw==} + /esbuild-linux-riscv64/0.15.9: + resolution: {integrity: sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -4488,8 +4525,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.15.6: - resolution: {integrity: sha512-OZeeDu32liefcwAE63FhVqM4heWTC8E3MglOC7SK0KYocDdY/6jyApw0UDkDHlcEK9mW6alX/SH9r3PDjcCo/Q==} + /esbuild-linux-s390x/0.15.9: + resolution: {integrity: sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -4514,8 +4551,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.15.6: - resolution: {integrity: sha512-kaxw61wcHMyiEsSsi5ut1YYs/hvTC2QkxJwyRvC2Cnsz3lfMLEu8zAjpBKWh9aU/N0O/gsRap4wTur5GRuSvBA==} + /esbuild-netbsd-64/0.15.9: + resolution: {integrity: sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -4540,8 +4577,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.15.6: - resolution: {integrity: sha512-CuoY60alzYfIZapUHqFXqXbj88bbRJu8Fp9okCSHRX2zWIcGz4BXAHXiG7dlCye5nFVrY72psesLuWdusyf2qw==} + /esbuild-openbsd-64/0.15.9: + resolution: {integrity: sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -4566,8 +4603,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.15.6: - resolution: {integrity: sha512-1ceefLdPWcd1nW/ZLruPEYxeUEAVX0YHbG7w+BB4aYgfknaLGotI/ZvPWUZpzhC8l1EybrVlz++lm3E6ODIJOg==} + /esbuild-sunos-64/0.15.9: + resolution: {integrity: sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -4592,8 +4629,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.15.6: - resolution: {integrity: sha512-pBqdOsKqCD5LRYiwF29PJRDJZi7/Wgkz46u3d17MRFmrLFcAZDke3nbdDa1c8YgY78RiemudfCeAemN8EBlIpA==} + /esbuild-windows-32/0.15.9: + resolution: {integrity: sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -4618,8 +4655,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.15.6: - resolution: {integrity: sha512-KpPOh4aTOo//g9Pk2oVAzXMpc9Sz9n5A9sZTmWqDSXCiiachfFhbuFlsKBGATYCVitXfmBIJ4nNYYWSOdz4hQg==} + /esbuild-windows-64/0.15.9: + resolution: {integrity: sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -4644,8 +4681,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.15.6: - resolution: {integrity: sha512-DB3G2x9OvFEa00jV+OkDBYpufq5x/K7a6VW6E2iM896DG4ZnAvJKQksOsCPiM1DUaa+DrijXAQ/ZOcKAqf/3Hg==} + /esbuild-windows-arm64/0.15.9: + resolution: {integrity: sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -4708,33 +4745,34 @@ packages: esbuild-windows-arm64: 0.14.50 dev: true - /esbuild/0.15.6: - resolution: {integrity: sha512-sgLOv3l4xklvXzzczhRwKRotyrfyZ2i1fCS6PTOLPd9wevDPArGU8HFtHrHCOcsMwTjLjzGm15gvC8uxVzQf+w==} + /esbuild/0.15.9: + resolution: {integrity: sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/linux-loong64': 0.15.6 - esbuild-android-64: 0.15.6 - esbuild-android-arm64: 0.15.6 - esbuild-darwin-64: 0.15.6 - esbuild-darwin-arm64: 0.15.6 - esbuild-freebsd-64: 0.15.6 - esbuild-freebsd-arm64: 0.15.6 - esbuild-linux-32: 0.15.6 - esbuild-linux-64: 0.15.6 - esbuild-linux-arm: 0.15.6 - esbuild-linux-arm64: 0.15.6 - esbuild-linux-mips64le: 0.15.6 - esbuild-linux-ppc64le: 0.15.6 - esbuild-linux-riscv64: 0.15.6 - esbuild-linux-s390x: 0.15.6 - esbuild-netbsd-64: 0.15.6 - esbuild-openbsd-64: 0.15.6 - esbuild-sunos-64: 0.15.6 - esbuild-windows-32: 0.15.6 - esbuild-windows-64: 0.15.6 - esbuild-windows-arm64: 0.15.6 + '@esbuild/android-arm': 0.15.9 + '@esbuild/linux-loong64': 0.15.9 + esbuild-android-64: 0.15.9 + esbuild-android-arm64: 0.15.9 + esbuild-darwin-64: 0.15.9 + esbuild-darwin-arm64: 0.15.9 + esbuild-freebsd-64: 0.15.9 + esbuild-freebsd-arm64: 0.15.9 + esbuild-linux-32: 0.15.9 + esbuild-linux-64: 0.15.9 + esbuild-linux-arm: 0.15.9 + esbuild-linux-arm64: 0.15.9 + esbuild-linux-mips64le: 0.15.9 + esbuild-linux-ppc64le: 0.15.9 + esbuild-linux-riscv64: 0.15.9 + esbuild-linux-s390x: 0.15.9 + esbuild-netbsd-64: 0.15.9 + esbuild-openbsd-64: 0.15.9 + esbuild-sunos-64: 0.15.9 + esbuild-windows-32: 0.15.9 + esbuild-windows-64: 0.15.9 + esbuild-windows-arm64: 0.15.9 /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -7665,7 +7703,7 @@ packages: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.10.1_ajqsvouysgwbbwdvvze7lmgc4q: + /rollup-plugin-esbuild/4.10.1_zprrkcbct7bo6atdakidof6o3q: resolution: {integrity: sha512-/ymcRB283zjFp1JTBXO8ekxv0c9vRc2L6OTljghsLthQ4vqeDSDWa9BVz1tHiVrx6SbUnUpDPLC0K/MXK7j5TA==} engines: {node: '>=12'} peerDependencies: @@ -7675,7 +7713,7 @@ packages: '@rollup/pluginutils': 4.2.1 debug: 4.3.4 es-module-lexer: 0.9.3 - esbuild: 0.15.6 + esbuild: 0.15.9 joycon: 3.1.1 jsonc-parser: 3.1.0 rollup: 2.79.0 @@ -8590,7 +8628,7 @@ packages: chalk: 5.0.1 consola: 2.15.3 defu: 6.1.0 - esbuild: 0.15.6 + esbuild: 0.15.9 globby: 13.1.2 hookable: 5.3.0 jiti: 1.14.0 @@ -8605,7 +8643,7 @@ packages: rimraf: 3.0.2 rollup: 2.79.0 rollup-plugin-dts: 4.2.2_id3sp2lbl4kx3dskm7teaj32um - rollup-plugin-esbuild: 4.10.1_ajqsvouysgwbbwdvvze7lmgc4q + rollup-plugin-esbuild: 4.10.1_zprrkcbct7bo6atdakidof6o3q scule: 0.3.2 typescript: 4.8.2 untyped: 0.4.7 @@ -9323,6 +9361,18 @@ packages: version: 0.0.0 dev: false + file:playground/ssr-resolve/entries: + resolution: {directory: playground/ssr-resolve/entries, type: directory} + name: entries + version: 0.0.0 + dev: false + + file:playground/ssr-resolve/pkg-exports: + resolution: {directory: playground/ssr-resolve/pkg-exports, type: directory} + name: pkg-exports-cjs + version: 0.0.0 + dev: false + file:playground/ssr-vue/example-external-component: resolution: {directory: playground/ssr-vue/example-external-component, type: directory} name: example-external-component