Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Mar 29, 2024
2 parents 3e158e6 + e14123f commit ecba0e8
Show file tree
Hide file tree
Showing 88 changed files with 1,066 additions and 912 deletions.
30 changes: 9 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
<!-- Thank you for contributing! -->

### Description

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

### Additional context

<!-- e.g. is there anything you'd like reviewers to focus on? -->

---

### What is the purpose of this pull request? <!-- (put an "X" next to an item) -->
<!-- What is this PR solving? Write a clear description or reference the issues it solves (e.g. `fixes #123`). What other alternatives have you explored? Are there any parts you think require more attention from reviewers? -->

- [ ] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
<!----------------------------------------------------------------------
Before creating the pull request, please make sure you do the following:
### Before submitting the PR, please make sure you do the following
- Read the Contributing Guidelines at https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md.
- Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us reviewing it.
- Update the corresponding documentation if needed.
- Include relevant tests that fail without this PR but pass with it.
- [ ] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md), especially the [Pull Request Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md#pull-request-guidelines).
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- [ ] Update the corresponding documentation if needed.
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
Thank you for contributing to Vite!
----------------------------------------------------------------------->
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # v42.1.0
uses: tj-actions/changed-files@20576b4b9ed46d41e2d45a2256e5e2316dde6834 # v43.0.1
with:
files: |
docs/**
Expand Down
4 changes: 4 additions & 0 deletions docs/config/shared-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ Whether to enable sourcemaps during dev.

Selects the engine used for CSS processing. Check out [Lightning CSS](../guide/features.md#lightning-css) for more information.

::: info Duplicate `@import`s
Note that postcss (postcss-import) has a different behavior with duplicated `@import` from browsers. See [postcss/postcss-import#462](https://github.com/postcss/postcss-import/issues/462).
:::

## css.lightningcss

- **Experimental:** [Give Feedback](https://github.com/vitejs/vite/discussions/13835)
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/api-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ A Vite plugin can additionally specify an `enforce` property (similar to webpack
- User plugins with `enforce: 'post'`
- Vite post build plugins (minify, manifest, reporting)
Note that this is separate from hooks ordering, those are still separately subject to their `order` attribute [as usual for Rollup hooks](https://rollupjs.org/plugin-development/#build-hooks).
## Conditional Application
By default plugins are invoked for both serve and build. In cases where a plugin needs to be conditionally applied only during serve or build, use the `apply` property to only invoke them during `'build'` or `'serve'`:
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/backend-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
<script type="module" src="/{{ manifest[name].file }}"></script>

<!-- for chunk of importedChunks(manifest, name) -->
<link rel="modulepreload" src="/{{ chunk.file }}" />
<link rel="modulepreload" href="/{{ chunk.file }}" />
```

Specifically, a backend generating HTML should include the following tags given a manifest
Expand All @@ -117,7 +117,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
- A `<link rel="stylesheet">` tag for each file in the entry point chunk's `css` list
- Recursively follow all chunks in the entry point's `imports` list and include a
`<link rel="stylesheet">` tag for each css file of each imported chunk.
- A tag for the `file` key of the entry point chunk (`<script type="moudle">` for Javascript,
- A tag for the `file` key of the entry point chunk (`<script type="module">` for Javascript,
or `<link rel="stylesheet">` for css)
- Optionally, `<link rel="modulepreload">` tag for the `file` of each imported Javascript
chunk, again recursively following the imports starting from the entry point chunk.
Expand All @@ -129,7 +129,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
<link rel="stylesheet" href="assets/shared.a834bfc3.css" />
<script type="module" src="assets/main.4889e940.js"></script>
<!-- optional -->
<link rel="modulepreload" src="assets/shared.83069a53.js" />
<link rel="modulepreload" href="assets/shared.83069a53.js" />
```

While the following should be included for the entry point `views/foo.js`:
Expand All @@ -138,5 +138,5 @@ If you need a custom integration, you can follow the steps in this guide to conf
<link rel="stylesheet" href="assets/shared.a834bfc3.css" />
<script type="module" src="assets/foo.869aea0d.js"></script>
<!-- optional -->
<link rel="modulepreload" src="assets/shared.83069a53.js" />
<link rel="modulepreload" href="assets/shared.83069a53.js" />
```
16 changes: 1 addition & 15 deletions docs/guide/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,7 @@ For example, you can specify multiple Rollup outputs with plugins that are only

## Chunking Strategy

You can configure how chunks are split using `build.rollupOptions.output.manualChunks` (see [Rollup docs](https://rollupjs.org/configuration-options/#output-manualchunks)). Until Vite 2.8, the default chunking strategy divided the chunks into `index` and `vendor`. It is a good strategy for some SPAs, but it is hard to provide a general solution for every Vite target use case. From Vite 2.9, `manualChunks` is no longer modified by default. You can continue to use the Split Vendor Chunk strategy by adding the `splitVendorChunkPlugin` in your config file:

```js
// vite.config.js
import { splitVendorChunkPlugin } from 'vite'
export default defineConfig({
plugins: [splitVendorChunkPlugin()],
})
```

This strategy is also provided as a `splitVendorChunk({ cache: SplitVendorChunkCache })` factory, in case composition with custom logic is needed. `cache.reset()` needs to be called at `buildStart` for build watch mode to work correctly in this case.

::: warning
You should use `build.rollupOptions.output.manualChunks` function form when using this plugin. If the object form is used, the plugin won't have any effect.
:::
You can configure how chunks are split using `build.rollupOptions.output.manualChunks` (see [Rollup docs](https://rollupjs.org/configuration-options/#output-manualchunks)). If you use a framework, refer to their documentation for configuring how chunks are splitted.

## Load Error Handling

Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"devDependencies": {
"@shikijs/vitepress-twoslash": "^1.2.0",
"@types/express": "^4.17.21",
"vitepress": "1.0.0-rc.45",
"vitepress": "1.0.1",
"vue": "^3.4.21"
}
}
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"@babel/types": "^7.24.0",
"@eslint-types/typescript-eslint": "^7.0.2",
"@eslint-types/typescript-eslint": "^7.2.0",
"@rollup/plugin-typescript": "^11.1.6",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.9.6",
Expand All @@ -53,21 +53,21 @@
"@types/fs-extra": "^11.0.4",
"@types/less": "^3.0.6",
"@types/micromatch": "^4.0.6",
"@types/node": "^20.11.28",
"@types/node": "^20.11.30",
"@types/picomatch": "^2.3.3",
"@types/sass": "~1.43.1",
"@types/semver": "^7.5.8",
"@types/stylus": "^0.48.42",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@vitejs/release-scripts": "^1.3.1",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.57.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-i": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-regexp": "^2.3.0",
"eslint-plugin-regexp": "^2.4.0",
"execa": "^8.0.1",
"feed": "^4.2.2",
"fs-extra": "^11.2.0",
Expand All @@ -79,7 +79,7 @@
"rimraf": "^5.0.5",
"rollup": "^4.13.0",
"semver": "^7.6.0",
"simple-git-hooks": "^2.11.0",
"simple-git-hooks": "^2.11.1",
"tslib": "^2.6.2",
"tsx": "^4.7.1",
"typescript": "^5.2.2",
Expand Down Expand Up @@ -123,8 +123,7 @@
},
"patchedDependencies": {
"chokidar@3.6.0": "patches/chokidar@3.6.0.patch",
"sirv@2.0.4": "patches/sirv@2.0.4.patch",
"postcss-import@16.0.1": "patches/postcss-import@16.0.1.patch"
"sirv@2.0.4": "patches/sirv@2.0.4.patch"
},
"peerDependencyRules": {
"allowedVersions": {
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.2.2",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
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.1.2"
},
"devDependencies": {
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
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 @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.19.6"
"preact": "^10.20.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.2",
"typescript": "^5.2.2",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
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 @@ -9,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.19.6"
"preact": "^10.20.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.2",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-qwik-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"serve": "^14.2.1",
"typescript": "^5.2.2",
"vite": "^5.2.0"
"vite": "^5.2.6"
},
"dependencies": {
"@builder.io/qwik": "^1.5.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"serve": "^14.2.1",
"vite": "^5.2.0"
"vite": "^5.2.6"
},
"dependencies": {
"@builder.io/qwik": "^1.5.1"
Expand Down
8 changes: 4 additions & 4 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.66",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"typescript": "^5.2.2",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
4 changes: 2 additions & 2 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.66",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
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.15"
"solid-js": "^1.8.16"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.2.0",
"vite": "^5.2.6",
"vite-plugin-solid": "^2.10.2"
}
}
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.15"
"solid-js": "^1.8.16"
},
"devDependencies": {
"vite": "^5.2.0",
"vite": "^5.2.6",
"vite-plugin-solid": "^2.10.2"
}
}
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 @@ -11,11 +11,11 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tsconfig/svelte": "^5.0.2",
"@tsconfig/svelte": "^5.0.3",
"svelte": "^4.2.12",
"svelte-check": "^3.6.7",
"svelte-check": "^3.6.8",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
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.2",
"svelte": "^4.2.12",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
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.2.0"
"vite": "^5.2.6"
}
}
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.2.0"
"vite": "^5.2.6"
}
}
6 changes: 1 addition & 5 deletions packages/create-vite/template-vue-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended Setup

- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur

- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
4 changes: 2 additions & 2 deletions 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.0.4",
"typescript": "^5.2.2",
"vite": "^5.2.0",
"vue-tsc": "^2.0.6"
"vite": "^5.2.6",
"vue-tsc": "^2.0.7"
}
}
4 changes: 1 addition & 3 deletions packages/create-vite/template-vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
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.0.4",
"vite": "^5.2.0"
"vite": "^5.2.6"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
"funding": "https://github.com/vitejs/vite?sponsor=1",
"dependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/core": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"browserslist": "^4.23.0",
"browserslist-to-esbuild": "^2.1.1",
"core-js": "^3.36.0",
"core-js": "^3.36.1",
"magic-string": "^0.30.8",
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.14.3"
Expand Down

0 comments on commit ecba0e8

Please sign in to comment.