Skip to content

Commit

Permalink
Merge branch 'main' into fix-merge-root-ssr-resvole-with-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 2, 2024
2 parents 767a2c1 + 3ffcb18 commit b820b48
Show file tree
Hide file tree
Showing 38 changed files with 451 additions and 378 deletions.
2 changes: 1 addition & 1 deletion docs/guide/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import imgUrl from './img.png'
document.getElementById('hero-img').src = imgUrl
```

For example, `imgUrl` will be `/img.png` during development, and become `/assets/img.2d8efhg.png` in the production build.
For example, `imgUrl` will be `/src/img.png` during development, and become `/assets/img.2d8efhg.png` in the production build.

The behavior is similar to webpack's `file-loader`. The difference is that the import can be either using absolute public paths (based on project root during dev) or relative paths.

Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"docs-serve": "vitepress serve"
},
"devDependencies": {
"@shikijs/vitepress-twoslash": "^1.23.1",
"@shikijs/vitepress-twoslash": "^1.24.0",
"@types/express": "^4.17.21",
"feed": "^4.2.2",
"vitepress": "^1.5.0",
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"ci-docs": "pnpm build && pnpm docs-build"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@eslint/js": "^9.16.0",
"@type-challenges/utils": "^0.1.1",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.9.7",
Expand All @@ -50,33 +50,33 @@
"@types/estree": "^1.0.6",
"@types/etag": "^1.8.3",
"@types/less": "^3.0.7",
"@types/node": "^22.9.3",
"@types/node": "^22.10.1",
"@types/picomatch": "^3.0.1",
"@types/stylus": "^0.48.43",
"@types/ws": "^8.5.13",
"@vitejs/release-scripts": "^1.3.2",
"conventional-changelog-cli": "^5.0.0",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-plugin-import-x": "^4.4.3",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-regexp": "^2.7.0",
"execa": "^9.5.1",
"globals": "^15.12.0",
"globals": "^15.13.0",
"gsap": "^3.12.5",
"lint-staged": "^15.2.10",
"picocolors": "^1.1.1",
"playwright-chromium": "^1.49.0",
"premove": "^4.0.0",
"prettier": "3.3.3",
"prettier": "3.4.1",
"rollup": "^4.23.0",
"rollup-plugin-esbuild": "^6.1.1",
"simple-git-hooks": "^2.11.1",
"tslib": "^2.8.1",
"tsx": "^4.19.2",
"typescript": "~5.6.2",
"typescript-eslint": "^8.15.0",
"typescript-eslint": "^8.16.0",
"vite": "workspace:*",
"vitest": "^2.1.5"
"vitest": "^2.1.6"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false"
Expand All @@ -95,7 +95,7 @@
"eslint --cache --fix"
]
},
"packageManager": "pnpm@9.14.2",
"packageManager": "pnpm@9.14.4",
"pnpm": {
"overrides": {
"vite": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-lit-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
},
"devDependencies": {
"typescript": "~5.6.2",
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"lit": "^3.2.1"
},
"devDependencies": {
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-preact-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.25.0"
"preact": "^10.25.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.9.1",
"@preact/preset-vite": "^2.9.2",
"typescript": "~5.6.2",
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.25.0"
"preact": "^10.25.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.9.1",
"vite": "^6.0.1"
"@preact/preset-vite": "^2.9.2",
"vite": "^6.0.2"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-qwik-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"devDependencies": {
"serve": "^14.2.4",
"typescript": "~5.6.2",
"vite": "^6.0.1"
"vite": "^6.0.2"
},
"dependencies": {
"@builder.io/qwik": "^1.10.0"
"@builder.io/qwik": "^1.11.0"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"devDependencies": {
"serve": "^14.2.4",
"vite": "^6.0.1"
"vite": "^6.0.2"
},
"dependencies": {
"@builder.io/qwik": "^1.10.0"
"@builder.io/qwik": "^1.11.0"
}
}
10 changes: 5 additions & 5 deletions packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@eslint/js": "^9.16.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.12.0",
"globals": "^15.13.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.15.0",
"vite": "^6.0.1"
"typescript-eslint": "^8.16.0",
"vite": "^6.0.2"
}
}
8 changes: 4 additions & 4 deletions packages/create-vite/template-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@eslint/js": "^9.16.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.12.0",
"vite": "^6.0.1"
"globals": "^15.13.0",
"vite": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-solid-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"typescript": "~5.6.2",
"vite": "^6.0.1",
"vite": "^6.0.2",
"vite-plugin-solid": "^2.11.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"solid-js": "^1.9.3"
},
"devDependencies": {
"vite": "^6.0.1",
"vite": "^6.0.2",
"vite-plugin-solid": "^2.11.0"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-svelte-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@sveltejs/vite-plugin-svelte": "^5.0.1",
"@tsconfig/svelte": "^5.0.4",
"svelte": "^5.2.7",
"svelte": "^5.3.1",
"svelte-check": "^4.1.0",
"tslib": "^2.8.1",
"typescript": "~5.6.2",
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"svelte": "^5.2.7",
"vite": "^6.0.1"
"@sveltejs/vite-plugin-svelte": "^5.0.1",
"svelte": "^5.3.1",
"vite": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"devDependencies": {
"typescript": "~5.6.2",
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"preview": "vite preview"
},
"devDependencies": {
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"typescript": "~5.6.2",
"vite": "^6.0.1",
"vite": "^6.0.2",
"vue-tsc": "^2.1.10"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.1"
"vite": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"browserslist": "^4.24.2",
"browserslist-to-esbuild": "^2.1.1",
"core-js": "^3.39.0",
"magic-string": "^0.30.13",
"magic-string": "^0.30.14",
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.15.1"
},
Expand Down
16 changes: 16 additions & 0 deletions packages/vite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## <small>6.0.2 (2024-12-02)</small>

* chore: run typecheck in unit tests (#18858) ([49f20bb](https://github.com/vitejs/vite/commit/49f20bb77749ec7b44344fd9c42d593ae20c78f0)), closes [#18858](https://github.com/vitejs/vite/issues/18858)
* chore: update broken links in changelog (#18802) ([cb754f8](https://github.com/vitejs/vite/commit/cb754f8acc1b579dae9fe70a08e3ef53984402cc)), closes [#18802](https://github.com/vitejs/vite/issues/18802)
* chore: update broken links in changelog (#18804) ([47ec49f](https://github.com/vitejs/vite/commit/47ec49ffa170cac5d04cf2eef01f45e0b5ccde03)), closes [#18804](https://github.com/vitejs/vite/issues/18804)
* fix: don't store temporary vite config file in `node_modules` if deno (#18823) ([a20267b](https://github.com/vitejs/vite/commit/a20267bb93118468a2e20f0f77b77ed7bfa94165)), closes [#18823](https://github.com/vitejs/vite/issues/18823)
* fix(css): referencing aliased svg asset with lightningcss enabled errored (#18819) ([ae68958](https://github.com/vitejs/vite/commit/ae6895869157e48b32088f0a1f85d2fddb2d713f)), closes [#18819](https://github.com/vitejs/vite/issues/18819)
* fix(manifest): use `style.css` as a key for the style file for `cssCodesplit: false` (#18820) ([ec51115](https://github.com/vitejs/vite/commit/ec511152558cb573acf55e88e5244bdead1b5a17)), closes [#18820](https://github.com/vitejs/vite/issues/18820)
* fix(optimizer): resolve all promises when cancelled (#18826) ([d6e6194](https://github.com/vitejs/vite/commit/d6e6194706f0e3a889caa9303de2293cc0f131b2)), closes [#18826](https://github.com/vitejs/vite/issues/18826)
* fix(resolve): don't set builtinModules to `external` by default (#18821) ([2250ffa](https://github.com/vitejs/vite/commit/2250ffac62e55c89232d745d2f99ece539be9195)), closes [#18821](https://github.com/vitejs/vite/issues/18821)
* fix(ssr): set `ssr.target: 'webworker'` defaults as fallback (#18827) ([b39e696](https://github.com/vitejs/vite/commit/b39e69638b3e2e658ff6712be83b549b28103c3d)), closes [#18827](https://github.com/vitejs/vite/issues/18827)
* feat(css): format lightningcss error (#18818) ([dac7992](https://github.com/vitejs/vite/commit/dac7992e8725234007c7515f86f543992874c7b8)), closes [#18818](https://github.com/vitejs/vite/issues/18818)
* refactor: make properties of ResolvedServerOptions and ResolvedPreviewOptions required (#18796) ([51a5569](https://github.com/vitejs/vite/commit/51a5569e66bd7f0de79ac14b9e902d1382ccd0aa)), closes [#18796](https://github.com/vitejs/vite/issues/18796)



## <small>6.0.1 (2024-11-27)</small>

* fix: default empty server `proxy` prevents starting http2 server (#18788) ([bbaf514](https://github.com/vitejs/vite/commit/bbaf514fb718952e0f17a15545c593125f1d1b9c)), closes [#18788](https://github.com/vitejs/vite/issues/18788)
Expand Down
10 changes: 5 additions & 5 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite",
"version": "6.0.1",
"version": "6.0.2",
"type": "module",
"license": "MIT",
"author": "Evan You",
Expand Down Expand Up @@ -75,7 +75,7 @@
"build": "premove dist && pnpm build-bundle && pnpm build-types",
"build-bundle": "rollup --config rollup.config.ts --configPlugin esbuild",
"build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check",
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node",
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node/tsconfig.build.json",
"build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && premove temp",
"build-types-check": "tsc --project tsconfig.check.json",
"typecheck": "tsc --noEmit && tsc --noEmit -p src/node",
Expand Down Expand Up @@ -122,11 +122,11 @@
"etag": "^1.8.1",
"http-proxy": "^1.18.1",
"launch-editor-middleware": "^2.9.1",
"lightningcss": "^1.28.1",
"magic-string": "^0.30.13",
"lightningcss": "^1.28.2",
"magic-string": "^0.30.14",
"mlly": "^1.7.3",
"mrmime": "^2.0.0",
"nanoid": "^5.0.8",
"nanoid": "^5.0.9",
"open": "^10.1.0",
"parse5": "^7.2.1",
"pathe": "^1.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/__tests__/config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http from 'node:http'
import { describe, expect, test } from 'vitest'
import type { InlineConfig } from '..'
import type { PluginOption, UserConfig, UserConfigExport } from '../config'
import type { InlineConfig, PluginOption } from '..'
import type { UserConfig, UserConfigExport } from '../config'
import { defineConfig, resolveConfig } from '../config'
import { resolveEnvPrefix } from '../env'
import { createLogger, mergeConfig } from '../publicUtils'
Expand Down
6 changes: 5 additions & 1 deletion packages/vite/src/node/__tests__/plugins/json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ test('can extract json error position', () => {
})

describe('transform', () => {
const transform = (input: string, opts: JsonOptions, isBuild: boolean) => {
const transform = (
input: string,
opts: Required<JsonOptions>,
isBuild: boolean,
) => {
const plugin = jsonPlugin(opts, isBuild)
return (plugin.transform! as Function)(input, 'test.json').code
}
Expand Down
8 changes: 0 additions & 8 deletions packages/vite/src/node/__tests__/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function handleParseError(
// Accept elements without closing tag in <head>
return
case 'duplicate-attribute':
// Accept duplicate attributes #9566
// Accept duplicate attributes #5966
// The first attribute is used, browsers silently ignore duplicates
return
case 'non-void-html-element-start-tag-with-trailing-solidus':
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/ssr/runtime/__tests__/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export async function createModuleRunnerTester(
}

beforeEach<TestClient>(async (t) => {
// @ts-ignore
globalThis.__HMR__ = {}

t.server = await createServer({
Expand Down
4 changes: 4 additions & 0 deletions packages/vite/src/node/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["**/__tests__"]
}
2 changes: 1 addition & 1 deletion packages/vite/src/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": ["./", "../module-runner", "../types"],
"exclude": ["../**/__tests__"],
"exclude": ["**/fixtures"],
"compilerOptions": {
// https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-18
"lib": ["ES2023", "DOM"], // DOM because we have client code that gets inlined via function.toString()
Expand Down
2 changes: 1 addition & 1 deletion playground/css-lightningcss-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"devDependencies": {
"lightningcss": "^1.28.1",
"lightningcss": "^1.28.2",
"express": "^5.0.1"
}
}
Loading

0 comments on commit b820b48

Please sign in to comment.