Skip to content

Commit a3c7322

Browse files
committed
chore: merge branch 'master' into dev
2 parents 027386e + 73e059a commit a3c7322

File tree

7 files changed

+61
-68
lines changed

7 files changed

+61
-68
lines changed

.github/CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ yarn
2626
# if you have the old vue-cli installed globally, you may
2727
# need to uninstall it first.
2828
cd packages/@vue/cli
29+
# before yarn link, you can delete the link in `~/.config/yarn/link/@vue` (see issue: [yarn link error message is not helpful](https://github.com/yarnpkg/yarn/issues/7054))
2930
yarn link
3031

3132
# create test projects in /packages/test

docs/guide/deployment.md

+37-61
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Typically, your static website will be hosted on https://yourUserName.gitlab.io/
145145

146146

147147
```javascript
148-
// vue.config.js file to be place in the root of your repository
148+
// vue.config.js file to be placed in the root of your repository
149149
150150
module.exports = {
151151
publicPath: process.env.NODE_ENV === 'production'
@@ -178,6 +178,21 @@ In order to receive direct hits using `history mode` on Vue Router, you need to
178178
179179
More information on [Netlify redirects documentation](https://www.netlify.com/docs/redirects/#history-pushstate-and-single-page-apps).
180180
181+
If you are using [@vue/cli-plugin-pwa](https://cli.vuejs.org/core-plugins/pwa.html#vue-cli-plugin-pwa) make sure to exclude the `_redirects` file from being cached by the service worker.
182+
To do so, add the following to your `vue.config.js`:
183+
```javascript
184+
// vue.config.js file to be placed in the root of your repository
185+
186+
module.exports = {
187+
pwa: {
188+
workboxOptions: {
189+
exclude: [/_redirects/]
190+
}
191+
}
192+
}
193+
```
194+
Checkout [workboxOptions](https://cli.vuejs.org/core-plugins/pwa.html#configuration) and [exclude](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-webpack-plugin.InjectManifest#InjectManifest) for more.
195+
181196
### Render
182197
183198
[Render](https://render.com) offers [free static site hosting](https://render.com/docs/static-sites) with fully managed SSL, a global CDN and continuous auto deploys from GitHub.
@@ -269,77 +284,38 @@ Please refer to the [Firebase Documentation](https://firebase.google.com/docs/ho
269284

270285
### Vercel
271286

272-
This example uses the latest Vercel platform version 2.
287+
[Vercel](https://vercel.com/home) is a cloud platform that enables developers to host Jamstack websites and web services that deploy instantly, scale automatically, and requires no supervision, all with zero configuration. They provide a global edge network, SSL encryption, asset compression, cache invalidation, and more.
273288

274-
1. Install the Vercel CLI:
289+
#### Step 1: Deploying your Vue project to Vercel
275290

276-
```bash
277-
npm install -g vercel
291+
To deploy your Vue project with a [Vercel for Git Integration](https://vercel.com/docs/git-integrations), make sure it has been pushed to a Git repository.
278292

279-
# Or, if you prefer a local one
280-
npm install vercel
281-
```
293+
Import the project into Vercel using the [Import Flow](https://vercel.com/import/git). During the import, you will find all relevant [options](https://vercel.com/docs/build-step#build-&-development-settings) preconfigured for you with the ability to change as needed.
282294

283-
2. Add a `vercel.json` file to your project root:
295+
After your project has been imported, all subsequent pushes to branches will generate [Preview Deployments](https://vercel.com/docs/platform/deployments#preview), and all changes made to the [Production Branch](https://vercel.com/docs/git-integrations#production-branch) (commonly "master" or "main") will result in a [Production Deployment](https://vercel.com/docs/platform/deployments#production).
284296

285-
```json
286-
{
287-
"name": "my-example-app",
288-
"version": 2,
289-
"builds": [
290-
{
291-
"src": "package.json",
292-
"use": "@vercel/static-build"
293-
}
294-
],
295-
"routes": [
296-
{
297-
"src": "/(js|css|img)/.*",
298-
"headers": { "cache-control": "max-age=31536000, immutable" }
299-
},
300-
{ "handle": "filesystem" },
301-
{ "src": ".*", "dest": "/" }
302-
],
303-
"alias": "example.com"
304-
}
305-
```
297+
Once deployed, you will get a URL to see your app live, such as the following: https://vue-example-tawny.vercel.app/.
306298

307-
If you have different/additional folders, modify the route accordingly:
308-
309-
```diff
310-
- {
311-
- "src": "/(js|css|img)/.*",
312-
- "headers": { "cache-control": "max-age=31536000, immutable" }
313-
- }
314-
+ {
315-
+ "src": "/(js|css|img|fonts|media)/.*",
316-
+ "headers": { "cache-control": "max-age=31536000, immutable" }
317-
+ }
318-
```
299+
#### Step 2 (optional): Using a Custom Domain
319300

320-
If your `outputDir` is not the default `dist`, say `build`:
321-
322-
```diff
323-
- {
324-
- "src": "package.json",
325-
- "use": "@vercel/static-build"
326-
- }
327-
+ {
328-
+ "src": "package.json",
329-
+ "use": "@vercel/static-build",
330-
+ "config": { "distDir": "build" }
331-
+ }
332-
```
301+
If you want to use a Custom Domain with your Vercel deployment, you can **Add** or **Transfer in** your domain via your Vercel [account Domain settings.](https://vercel.com/dashboard/domains)
333302

334-
3. Adding a `now-build` script in `package.json`:
303+
To add your domain to your project, navigate to your [Project](https://vercel.com/docs/platform/projects) from the Vercel Dashboard. Once you have selected your project, click on the "Settings" tab, then select the **Domains** menu item. From your projects **Domain** page, enter the domain you wish to add to your project.
335304

336-
```json
337-
"vercel-build": "npm run build"
338-
```
305+
Once the domain as been added, you will be presented with different methods for configuring it.
306+
307+
#### Deploying a fresh Vue project
308+
309+
You can deploy a fresh Vue project, with a Git repository set up for you, with the following Deploy Button:
310+
311+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2Fvercel%2Fvercel%2Ftree%2Fmaster%2Fexamples%2Fvue)
339312

340-
To make a deployment, run `vercel`.
313+
## References:
341314

342-
If you want your deployment aliased, run `vercel --target production` instead.
315+
- [Example Source](https://github.com/vercel/vercel/tree/master/examples/vue)
316+
- [Official Vercel Guide](https://vercel.com/guides/deploying-vuejs-to-vercel)
317+
- [Vercel Deployment Docs](https://vercel.com/docs)
318+
- [Vercel Custom Domain Docs](https://vercel.com/docs/custom-domains)
343319

344320
### Stdlib
345321

docs/guide/installation.md

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ If you have the previous `vue-cli` (1.x or 2.x) package installed globally, you
77

88
::: tip Node Version Requirement
99
Vue CLI 4.x requires [Node.js](https://nodejs.org/) version 8.9 or above (v10+ recommended). You can manage multiple versions of Node on the same machine with [n](https://github.com/tj/n), [nvm](https://github.com/creationix/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows).
10-
11-
As Node.js v8 has reached end-of-life, it's now recommended to use Node.js v10+ for best compatibility.
12-
If you have to stay with Node.js v8, please make sure npm v6 is used as the default package manager. (`npm -v` to check the version, and `vue config --set packageManager npm` to set the default package manager.)
1310
:::
1411

1512
To install the new package, use one of the following commands. You need administrator privileges to execute these unless npm was installed on your system through a Node.js version manager (e.g. n or nvm).

docs/guide/webpack.md

+5
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ You can redirect the output into a file for easier inspection:
160160
``` bash
161161
vue inspect > output.js
162162
```
163+
By default, `inspect` command will show the output for development config. To see the production configuration, you need to run
164+
165+
``` bash
166+
vue inspect --mode production > output.prod.js
167+
```
163168

164169
Note the output is not a valid webpack config file, it's a serialized format only meant for inspection.
165170

docs/zh/guide/build-targets.md

+17
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,20 @@ dist/foo.1.js 5.24 kb 1.64 kb
144144
<!-- foo-one 的实现的 chunk 会在用到的时候自动获取 -->
145145
<foo-one></foo-one>
146146
```
147+
148+
## 在构建时使用 vuex
149+
在构建 [Web Components 组件](#web-components-组件)[](#库)时,入口点不是 `main.js` ,而是 `entry-wc.js` 文件,该文件由此生成: https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/commands/build/resolveWcEntry.js
150+
151+
因此,要在 Web Components 组件的目标中使用 vuex ,你需要在 `App.vue` 中初始化存储 (store):
152+
``` js
153+
import store from './store'
154+
155+
// ...
156+
157+
export default {
158+
store,
159+
name: 'App',
160+
// ...
161+
}
162+
```
163+

docs/zh/guide/installation.md

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ Vue CLI 的包名称由 `vue-cli` 改成了 `@vue/cli`。
77

88
::: tip Node 版本要求
99
Vue CLI 4.x 需要 [Node.js](https://nodejs.org/) v8.9 或更高版本 (推荐 v10 以上)。你可以使用 [n](https://github.com/tj/n)[nvm](https://github.com/creationix/nvm)[nvm-windows](https://github.com/coreybutler/nvm-windows) 在同一台电脑中管理多个 Node 版本。
10-
11-
由于 Node.js v8 已不再维护,我们建议使用 Node.js v10 以上的版本,以保证最佳的兼容性。
12-
如果暂时无法升级 Node.js 版本,请使用 npm v6 作为默认的包管理工具。(可以用 `npm -v` 检查 npm 版本,然后运行 `vue config --set packageManager npm` 以设置默认包管理工具。)
1310
:::
1411

1512
可以使用下列任一命令安装这个新的包:

packages/@vue/cli-ui/locales/en.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@
629629
"css": {
630630
"modules": {
631631
"label": "Enable CSS Modules",
632-
"description": "By default, only files that ends in *.module.[ext] are treated as CSS modules. Enabling this will treat all style files as CSS modules."
632+
"description": "By default, only files that end with *.module.[ext] are treated as CSS modules. Enabling this will treat all style files as CSS modules."
633633
},
634634
"extract": {
635635
"label": "Extract CSS",

0 commit comments

Comments
 (0)