Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Jan 12, 2024
2 parents f5106ac + 4d1342e commit 65c272e
Show file tree
Hide file tree
Showing 78 changed files with 1,428 additions and 2,196 deletions.
11 changes: 5 additions & 6 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const { defineConfig } = require('eslint-define-config')
const pkg = require('./package.json')

/// <reference types="@eslint-types/typescript-eslint" />
/// <reference types="@eslint-types/import" />

module.exports = defineConfig({
root: true,
Expand All @@ -16,7 +15,7 @@ module.exports = defineConfig({
'plugin:regexp/recommended',
],
ignorePatterns: ['packages/create-vite/template-**'],
plugins: ['import', 'regexp'],
plugins: ['i', 'regexp'],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
Expand Down Expand Up @@ -93,12 +92,12 @@ module.exports = defineConfig({
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/prefer-function-type': 'off',

'import/no-nodejs-modules': [
'i/no-nodejs-modules': [
'error',
{ allow: builtinModules.map((mod) => `node:${mod}`) },
],
'import/no-duplicates': 'error',
'import/order': 'error',
'i/no-duplicates': 'error',
'i/order': 'error',
'sort-imports': [
'error',
{
Expand Down Expand Up @@ -213,7 +212,7 @@ module.exports = defineConfig({
'playground/tailwind/**', // blocked by https:/postcss/postcss-load-config/issues/239
],
rules: {
'import/no-commonjs': 'error',
'i/no-commonjs': 'error',
},
},
{
Expand Down
4 changes: 3 additions & 1 deletion docs/config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ Specify the directory to nest generated assets under (relative to `build.outDir`
## build.assetsInlineLimit
- **Type:** `number`
- **Type:** `number` | `((filePath: string, content: Buffer) => boolean | undefined)`
- **Default:** `4096` (4 KiB)
Imported or referenced assets that are smaller than this threshold will be inlined as base64 URLs to avoid extra http requests. Set to `0` to disable inlining altogether.
If a callback is passed, a boolean can be returned to opt-in or opt-out. If nothing is returned the default logic applies.
Git LFS placeholders are automatically excluded from inlining because they do not contain the content of the file they represent.
::: tip Note
Expand Down
14 changes: 11 additions & 3 deletions docs/config/ssr-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@

## ssr.external

- **Type:** `string[]`
- **Type:** `string[] | true`
- **Related:** [SSR Externals](/guide/ssr#ssr-externals)

Force externalize dependencies for SSR.
Externalize the given dependencies and their transitive dependencies for SSR. By default, all dependencies are externalized except for linked dependencies (for HMR). If you prefer to externalize the linked dependency, you can pass its name to this option.

If `true`, all dependencies including linked dependencies are externalized.

Note that the explicitly listed dependencies (using `string[]` type) will always take priority if they're also listed in `ssr.noExternal` (using any type).

## ssr.noExternal

- **Type:** `string | RegExp | (string | RegExp)[] | true`
- **Related:** [SSR Externals](/guide/ssr#ssr-externals)

Prevent listed dependencies from being externalized for SSR. If `true`, no dependencies are externalized.
Prevent listed dependencies from being externalized for SSR, which they will get bundled in build. By default, only linked dependencies are not externalized (for HMR). If you prefer to externalize the linked dependency, you can pass its name to the `ssr.external` option.

If `true`, no dependencies are externalized. However, dependencies explicitly listed in `ssr.external` (using `string[]` type) can take priority and still be externalized.

Note that if both `ssr.noExternal: true` and `ssr.external: true` are configured, `ssr.noExternal` takes priority and no dependencies are externalized.

## ssr.target

Expand Down
4 changes: 4 additions & 0 deletions docs/guide/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ While Vite is fast by default, performance issues can creep in as the project's
- Slow page loads
- Slow builds

## Avoid Browser Extensions

Some browser extensions may interfere with requests and slow down startup and reload times for large apps, especially when using browser dev tools. We recommend creating a dev-only profile without extensions, or switch to incognito mode, while using Vite's dev server in these cases. Incognito mode should also be faster than a regular profile without extensions.

## Audit Configured Vite Plugins

Vite's internal and official plugins are optimized to do the least amount of work possible while providing compatibility with the broader ecosystem. For example, code transformations use regex in dev, but do a complete parse in build to ensure correctness.
Expand Down
32 changes: 15 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
},
"devDependencies": {
"@babel/types": "^7.23.6",
"@eslint-types/import": "^2.29.0-1",
"@eslint-types/typescript-eslint": "^6.12.0",
"@rollup/plugin-typescript": "^11.1.5",
"@eslint-types/typescript-eslint": "^6.18.1",
"@rollup/plugin-typescript": "^11.1.6",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.9.6",
"@types/convert-source-map": "^2.0.3",
Expand All @@ -53,24 +52,23 @@
"@types/estree": "^1.0.5",
"@types/etag": "^1.8.3",
"@types/fs-extra": "^11.0.4",
"@types/json-stable-stringify": "^1.0.36",
"@types/less": "^3.0.6",
"@types/micromatch": "^4.0.6",
"@types/node": "^20.10.4",
"@types/node": "^20.11.0",
"@types/picomatch": "^2.3.3",
"@types/sass": "~1.43.1",
"@types/semver": "^7.5.6",
"@types/stylus": "^0.48.42",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitejs/release-scripts": "^1.3.1",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.55.0",
"eslint-define-config": "^2.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-regexp": "^2.1.2",
"eslint": "^8.56.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-i": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-regexp": "^2.2.0",
"execa": "^8.0.1",
"feed": "^4.2.2",
"fs-extra": "^11.2.0",
Expand All @@ -84,13 +82,13 @@
"semver": "^7.5.4",
"simple-git-hooks": "^2.9.0",
"tslib": "^2.6.2",
"tsx": "^4.6.2",
"tsx": "^4.7.0",
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"vite": "workspace:*",
"vitepress": "1.0.0-rc.31",
"vitest": "^1.0.4",
"vue": "^3.3.11"
"vitepress": "1.0.0-rc.36",
"vitest": "^1.1.3",
"vue": "^3.4.9"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false"
Expand All @@ -109,7 +107,7 @@
"eslint --cache --fix"
]
},
"packageManager": "pnpm@8.12.0",
"packageManager": "pnpm@8.14.1",
"pnpm": {
"overrides": {
"vite": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-vite/template-lit-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"lit": "^3.1.0"
"lit": "^3.1.1"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"preview": "vite preview"
},
"dependencies": {
"lit": "^3.1.0"
"lit": "^3.1.1"
},
"devDependencies": {
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-preact-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"preact": "^10.19.3"
},
"devDependencies": {
"@preact/preset-vite": "^2.7.0",
"@preact/preset-vite": "^2.8.1",
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"preact": "^10.19.3"
},
"devDependencies": {
"@preact/preset-vite": "^2.7.0",
"vite": "^5.0.8"
"@preact/preset-vite": "^2.8.1",
"vite": "^5.0.11"
}
}
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 @@ -10,9 +10,9 @@
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
},
"dependencies": {
"@builder.io/qwik": "^1.3.0"
"@builder.io/qwik": "^1.3.3"
}
}
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": {
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
},
"dependencies": {
"@builder.io/qwik": "^1.3.0"
"@builder.io/qwik": "^1.3.3"
}
}
12 changes: 6 additions & 6 deletions packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
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,13 +14,13 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-solid-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"solid-js": "^1.8.7"
"solid-js": "^1.8.10"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vite": "^5.0.11",
"vite-plugin-solid": "^2.8.0"
}
}
4 changes: 2 additions & 2 deletions packages/create-vite/template-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"solid-js": "^1.8.7"
"solid-js": "^1.8.10"
},
"devDependencies": {
"vite": "^5.0.8",
"vite": "^5.0.11",
"vite-plugin-solid": "^2.8.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-svelte-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"svelte-check": "^3.6.2",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"svelte": "^4.2.8",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
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.2.2",
"vite": "^5.0.8"
"vite": "^5.0.11"
}
}
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": "^5.0.8"
"vite": "^5.0.11"
}
}
8 changes: 4 additions & 4 deletions packages/create-vite/template-vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.3.11"
"vue": "^3.4.9"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.2",
"@vitejs/plugin-vue": "^5.0.3",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vue-tsc": "^1.8.25"
"vite": "^5.0.11",
"vue-tsc": "^1.8.27"
}
}
6 changes: 3 additions & 3 deletions packages/create-vite/template-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.3.11"
"vue": "^3.4.9"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.2",
"vite": "^5.0.8"
"@vitejs/plugin-vue": "^5.0.3",
"vite": "^5.0.11"
}
}
12 changes: 6 additions & 6 deletions packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
"homepage": "https:/vitejs/vite/tree/main/packages/plugin-legacy#readme",
"funding": "https:/vitejs/vite?sponsor=1",
"dependencies": {
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"browserslist": "^4.22.2",
"core-js": "^3.34.0",
"core-js": "^3.35.0",
"magic-string": "^0.30.5",
"regenerator-runtime": "^0.14.0",
"systemjs": "^6.14.2"
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.14.3"
},
"peerDependencies": {
"terser": "^5.4.0",
"vite": "^5.0.0"
},
"devDependencies": {
"acorn": "^8.11.2",
"acorn": "^8.11.3",
"picocolors": "^1.0.0",
"vite": "workspace:*"
}
Expand Down
Loading

0 comments on commit 65c272e

Please sign in to comment.