Skip to content

Commit

Permalink
chore: merge branch 'main' into fix/legacy-force-target
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Sep 18, 2022
2 parents 740fe11 + fc5310f commit 0605081
Show file tree
Hide file tree
Showing 48 changed files with 546 additions and 812 deletions.
54 changes: 0 additions & 54 deletions docs/guide/static-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,60 +276,6 @@ You can also add custom domains and handle custom build settings on Pages. Learn

You can also deploy to a [custom domain](http://surge.sh/help/adding-a-custom-domain) by adding `surge dist yourdomain.com`.

## Heroku

1. Install [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).

2. Create a Heroku account by [signing up](https://signup.heroku.com).

3. Run `heroku login` and fill in your Heroku credentials:

```bash
$ heroku login
```

4. Create a file called `static.json` in the root of your project with the below content:

`static.json`:

```json
{
"root": "./dist"
}
```

This is the configuration of your site; read more at [heroku-buildpack-static](https://github.com/heroku/heroku-buildpack-static).

5. Set up your Heroku git remote:

```bash
# version change
$ git init
$ git add .
$ git commit -m "My site ready for deployment."

# creates a new app with a specified name
$ heroku apps:create example
```

6. Set buildpacks. We use `heroku/nodejs` to build the project and `heroku-buildpack-static` to serve it.

```bash
# set buildpacks
$ heroku buildpacks:set heroku/nodejs
$ heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static.git
```

7. Deploy your site:

```bash
# publish site
$ git push heroku main

# opens a browser to view the Dashboard version of Heroku CI
$ heroku open
```

## Azure Static Web Apps

You can quickly deploy your Vite app with Microsoft Azure [Static Web Apps](https://aka.ms/staticwebapps) service. You need:
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"ci-docs": "run-s build docs-build"
},
"devDependencies": {
"@babel/types": "^7.18.13",
"@babel/types": "^7.19.0",
"@microsoft/api-extractor": "^7.30.0",
"@rollup/plugin-typescript": "^8.4.0",
"@rollup/plugin-typescript": "^8.5.0",
"@types/babel__core": "^7.1.19",
"@types/babel__standalone": "^7.1.4",
"@types/convert-source-map": "^1.5.2",
Expand All @@ -57,22 +57,22 @@
"@types/semver": "^7.3.12",
"@types/stylus": "^0.48.38",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"@typescript-eslint/parser": "^5.36.2",
"conventional-changelog-cli": "^2.2.2",
"esbuild": "^0.14.47",
"eslint": "^8.23.0",
"eslint": "^8.23.1",
"eslint-define-config": "^1.7.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"execa": "^6.1.0",
"fast-glob": "^3.2.11",
"fast-glob": "^3.2.12",
"fs-extra": "^10.1.0",
"lint-staged": "^13.0.3",
"minimist": "^1.2.6",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.25.1",
"playwright-chromium": "^1.25.2",
"pnpm": "^7.11.0",
"prettier": "2.7.1",
"prompts": "^2.4.2",
Expand All @@ -88,8 +88,8 @@
"unbuild": "^0.8.10",
"vite": "workspace:*",
"vitepress": "^1.0.0-alpha.13",
"vitest": "^0.23.1",
"vue": "^3.2.38"
"vitest": "^0.23.2",
"vue": "^3.2.39"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"homepage": "https://github.com/vitejs/vite/tree/main/packages/create-vite#readme",
"devDependencies": {
"cross-spawn": "^7.0.3",
"kolorist": "^1.5.1",
"kolorist": "^1.6.0",
"minimist": "^1.2.6",
"prompts": "^2.4.2"
}
Expand Down
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,10 +9,10 @@
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.10.6"
"preact": "^10.11.0"
},
"devDependencies": {
"@preact/preset-vite": "^2.3.1",
"@preact/preset-vite": "^2.4.0",
"typescript": "^4.6.4",
"vite": "^3.1.0"
}
Expand Down
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.10.6"
"preact": "^10.11.0"
},
"devDependencies": {
"@preact/preset-vite": "^2.3.1",
"@preact/preset-vite": "^2.4.0",
"vite": "^3.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.18",
"@types/react": "^18.0.19",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"typescript": "^4.6.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.18",
"@types/react": "^18.0.19",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^2.1.0",
"vite": "^3.1.0"
Expand Down
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 @@ -12,7 +12,7 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.5",
"@tsconfig/svelte": "^3.0.0",
"svelte": "^3.50.0",
"svelte": "^3.50.1",
"svelte-check": "^2.9.0",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
Expand Down
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 @@ -10,7 +10,7 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.5",
"svelte": "^3.50.0",
"svelte": "^3.50.1",
"vite": "^3.1.0"
}
}
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 @@ -9,12 +9,12 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.38"
"vue": "^3.2.39"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.1.0",
"typescript": "^4.6.4",
"vite": "^3.1.0",
"vue-tsc": "^0.40.7"
"vue-tsc": "^0.40.13"
}
}
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 @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.38"
"vue": "^3.2.39"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
"dependencies": {
"@babel/standalone": "^7.18.13",
"core-js": "^3.25.0",
"@babel/standalone": "^7.19.0",
"core-js": "^3.25.1",
"magic-string": "^0.26.3",
"regenerator-runtime": "^0.13.9",
"systemjs": "^6.12.6"
Expand All @@ -46,7 +46,7 @@
"vite": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.18.13",
"@babel/core": "^7.19.0",
"picocolors": "^1.0.0",
"vite": "workspace:*"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-react#readme",
"dependencies": {
"@babel/core": "^7.18.13",
"@babel/plugin-transform-react-jsx": "^7.18.10",
"@babel/core": "^7.19.0",
"@babel/plugin-transform-react-jsx": "^7.19.0",
"@babel/plugin-transform-react-jsx-development": "^7.18.6",
"@babel/plugin-transform-react-jsx-self": "^7.18.6",
"@babel/plugin-transform-react-jsx-source": "^7.18.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-vue-jsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx#readme",
"dependencies": {
"@babel/core": "^7.18.13",
"@babel/core": "^7.19.0",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.18.12",
"@babel/plugin-transform-typescript": "^7.19.0",
"@vue/babel-plugin-jsx": "^1.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"slash": "^4.0.0",
"source-map": "^0.6.1",
"vite": "workspace:*",
"vue": "^3.2.38"
"vue": "^3.2.39"
}
}
24 changes: 24 additions & 0 deletions packages/vite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## <small>3.1.2 (2022-09-17)</small>

* fix: use isOptimizable to ensure version query (#10141) ([23a51c6](https://github.com/vitejs/vite/commit/23a51c6)), closes [#10141](https://github.com/vitejs/vite/issues/10141)



## <small>3.1.1 (2022-09-15)</small>

* fix: ensure version query for relative node_modules imports (#10016) ([1b822d0](https://github.com/vitejs/vite/commit/1b822d0)), closes [#10016](https://github.com/vitejs/vite/issues/10016)
* fix: no quote on attrs (#10117) ([f541239](https://github.com/vitejs/vite/commit/f541239)), closes [#10117](https://github.com/vitejs/vite/issues/10117)
* fix: prevent error overlay style being overridden (fixes #9969) (#9971) ([a7706d0](https://github.com/vitejs/vite/commit/a7706d0)), closes [#9969](https://github.com/vitejs/vite/issues/9969) [#9971](https://github.com/vitejs/vite/issues/9971)
* fix: proxy to secured websocket server (#10045) ([9de9bc4](https://github.com/vitejs/vite/commit/9de9bc4)), closes [#10045](https://github.com/vitejs/vite/issues/10045)
* fix: replace white with reset (#10104) ([5d56e42](https://github.com/vitejs/vite/commit/5d56e42)), closes [#10104](https://github.com/vitejs/vite/issues/10104)
* 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)
* fix(preview): send configured headers (#9976) ([0d20eae](https://github.com/vitejs/vite/commit/0d20eae)), closes [#9976](https://github.com/vitejs/vite/issues/9976)
* chore: cleanup old changelogs (#10056) ([9e65a41](https://github.com/vitejs/vite/commit/9e65a41)), closes [#10056](https://github.com/vitejs/vite/issues/10056)
* chore: update 3.1 changelog (#9994) ([44dbcbe](https://github.com/vitejs/vite/commit/44dbcbe)), closes [#9994](https://github.com/vitejs/vite/issues/9994)
* chore(deps): update @rollup/plugin-node-resolve to v14 (#10078) ([3390c87](https://github.com/vitejs/vite/commit/3390c87)), closes [#10078](https://github.com/vitejs/vite/issues/10078)
* refactor: config hook helper function (#9982) ([9c1be10](https://github.com/vitejs/vite/commit/9c1be10)), closes [#9982](https://github.com/vitejs/vite/issues/9982)
* refactor: optimize `async` and `await` in code (#9854) ([31f5ff3](https://github.com/vitejs/vite/commit/31f5ff3)), closes [#9854](https://github.com/vitejs/vite/issues/9854)



## 3.1.0 (2022-09-05)

### Main Changes
Expand Down
12 changes: 6 additions & 6 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite",
"version": "3.1.0",
"version": "3.1.2",
"type": "module",
"license": "MIT",
"author": "Evan You",
Expand Down Expand Up @@ -68,15 +68,15 @@
},
"devDependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/parser": "^7.18.13",
"@babel/types": "^7.18.13",
"@babel/parser": "^7.19.0",
"@babel/types": "^7.19.0",
"@jridgewell/trace-mapping": "^0.3.15",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-dynamic-import-vars": "^1.4.4",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-typescript": "^8.4.0",
"@rollup/plugin-node-resolve": "14.0.1",
"@rollup/plugin-typescript": "^8.5.0",
"@rollup/pluginutils": "^4.2.1",
"acorn": "^8.8.0",
"cac": "^6.7.14",
Expand All @@ -92,7 +92,7 @@
"es-module-lexer": "^1.0.3",
"estree-walker": "^3.0.1",
"etag": "^1.8.1",
"fast-glob": "^3.2.11",
"fast-glob": "^3.2.12",
"http-proxy": "^1.18.1",
"json5": "^2.2.1",
"launch-editor-middleware": "^2.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ cli
const viteStartTime = global.__vite_start_time ?? false
const startupDurationString = viteStartTime
? colors.dim(
`ready in ${colors.white(
`ready in ${colors.reset(
colors.bold(Math.ceil(performance.now() - viteStartTime))
)} ms`
)
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function printServerUrls(
info(` ${colors.green('➜')} ${colors.bold('Network')}: ${colorUrl(url)}`)
}
if (urls.network.length === 0 && optionsHost === undefined) {
const note = `use ${colors.white(colors.bold('--host'))} to expose`
const note = `use ${colors.reset(colors.bold('--host'))} to expose`
info(
colors.dim(` ${colors.green('➜')} ${colors.bold('Network')}: ${note}`)
)
Expand Down
20 changes: 15 additions & 5 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,22 @@ function esbuildOutputFromId(
id: string,
cacheDirOutputPath: string
): any {
const cwd = process.cwd()
const flatId = flattenId(id) + '.js'
return outputs[
normalizePath(
path.relative(process.cwd(), path.join(cacheDirOutputPath, flatId))
)
]
const normalizedOutputPath = normalizePath(
path.relative(cwd, path.join(cacheDirOutputPath, flatId))
)
const output = outputs[normalizedOutputPath]
if (output) {
return output
}
// If the root dir was symlinked, esbuild could return output keys as `../cwd/`
// Normalize keys to support this case too
for (const [key, value] of Object.entries(outputs)) {
if (normalizePath(path.relative(cwd, key)) === normalizedOutputPath) {
return value
}
}
}

export async function extractExportsData(
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function getScriptInfo(node: DefaultTreeAdapterMap['element']): {
return { src, sourceCodeLocation, isModule, isAsync }
}

const attrValueStartRE = /=[\s\t\n\r]*(["']|.)/
const attrValueStartRE = /=[\s\t\n\r]*(.)/

export function overwriteAttrValue(
s: MagicString,
Expand All @@ -214,7 +214,7 @@ export function overwriteAttrValue(
`[vite:html] internal error, failed to overwrite attribute value`
)
}
const wrapOffset = valueStart[1] ? 1 : 0
const wrapOffset = valueStart[1] === '"' || valueStart[1] === "'" ? 1 : 0
const valueOffset = valueStart.index! + valueStart[0].length - 1
s.overwrite(
sourceCodeLocation.startOffset + valueOffset + wrapOffset,
Expand Down
Loading

0 comments on commit 0605081

Please sign in to comment.