Skip to content

Commit

Permalink
Merge branch 'main' into feat/ssr-circular-import
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored Jul 18, 2021
2 parents 40e7812 + e47a6f2 commit c0f4983
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Lock Closed Issues

on:
schedule:
- cron: "0 0 * * *"
- cron: "0 0 */7 * *"

permissions:
issues: write
Expand All @@ -15,9 +15,9 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-inactive-days: "14"
issue-lock-comment: |
This issue has been locked since it has been closed for more than 14 days.
If you have found a concrete bug or regression related to it, please open a new [bug report](https://github.com/vitejs/vite/issues/new/choose) with a reproduction against the latest Vite version. If you have any other comments you should join the chat at [Vite Land](https://chat.vitejs.dev) or create a new [discussion](https://github.com/vitejs/vite/discussions).
#issue-lock-comment: |
# This issue has been locked since it has been closed for more than 14 days.
#
# If you have found a concrete bug or regression related to it, please open a new [bug report](https://github.com/vitejs/vite/issues/new/choose) with a reproduction against the latest Vite version. If you have any other comments you should join the chat at [Vite Land](https://chat.vitejs.dev) or create a new [discussion](https://github.com/vitejs/vite/discussions).
issue-lock-reason: ""
process-only: "issues"
10 changes: 5 additions & 5 deletions docs/guide/api-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Vite's JavaScript APIs are fully typed, and it's recommended to use TypeScript o

## `createServer`

**Type Signature**
**Type Signature:**

```ts
async function createServer(inlineConfig?: InlineConfig): Promise<ViteDevServer>
```

**Example Usage**
**Example Usage:**

```js
const { createServer } = require('vite')
Expand Down Expand Up @@ -121,15 +121,15 @@ interface ViteDevServer {

## `build`

**Type Signature**
**Type Signature:**

```ts
async function build(
inlineConfig?: InlineConfig
): Promise<RollupOutput | RollupOutput[]>
```

**Example Usage**
**Example Usage:**

```js
const path = require('path')
Expand All @@ -150,7 +150,7 @@ const { build } = require('vite')

## `resolveConfig`

**Type Signature**
**Type Signature:**

```ts
async function resolveConfig(
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/api-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo

Modify Vite config before it's resolved. The hook receives the raw user config (CLI options merged with config file) and the current config env which exposes the `mode` and `command` being used. It can return a partial config object that will be deeply merged into existing config, or directly mutate the config (if the default merging cannot achieve the desired result).

**Example**
**Example:**

```js
// return partial config (recommended)
Expand Down Expand Up @@ -289,7 +289,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
- An array of tag descriptor objects (`{ tag, attrs, children }`) to inject to the existing HTML. Each tag can also specify where it should be injected to (default is prepending to `<head>`)
- An object containing both as `{ html, tags }`

**Basic Example**
**Basic Example:**

```js
const htmlPlugin = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/ssr-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
font-style: italic;
font-weight: 400;
font-display: swap;
src: url('./assets/fonts/Inter-Italic.woff2?#iefix') format('woff2'),
src: url('./assets/fonts/Inter-Italic.woff2#iefix') format('woff2'),
url('./assets/fonts/Inter-Italic.woff') format('woff');
}
.inter {
Expand Down
10 changes: 4 additions & 6 deletions packages/playground/ssr-vue/src/entry-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ function renderPreloadLink(file) {
} else if (file.endsWith('.woff2')) {
return ` <link rel="preload" href="${file}" as="font" type="font/woff2" crossorigin>`
} else if (file.endsWith('.gif')) {
return ` <link rel="preload" href="${file}" as="image" type="image/gif" crossorigin>`
} else if (file.endsWith('.jpg')) {
return ` <link rel="preload" href="${file}" as="image" type="image/jpeg" crossorigin>`
} else if (file.endsWith('.jpeg')) {
return ` <link rel="preload" href="${file}" as="image" type="image/jpeg" crossorigin>`
return ` <link rel="preload" href="${file}" as="image" type="image/gif">`
} else if (file.endsWith('.jpg') || file.endsWith('.jpeg')) {
return ` <link rel="preload" href="${file}" as="image" type="image/jpeg">`
} else if (file.endsWith('.png')) {
return ` <link rel="preload" href="${file}" as="image" type="image/png" crossorigin>`
return ` <link rel="preload" href="${file}" as="image" type="image/png">`
} else {
// TODO
return ''
Expand Down

0 comments on commit c0f4983

Please sign in to comment.