Skip to content

Commit

Permalink
Merge branch 'master' into translate-migrate-from-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mactanxin committed Jan 31, 2020
2 parents df294f8 + 9e18f3c commit 33779ac
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docs/guide/prototyping.md
@@ -1,11 +1,11 @@
# Instant Prototyping

You can rapidly prototype with just a single `*.vue` file with the `vue serve` and `vue build` commands, but they require an additional global addon to be installed first:
You can rapidly prototype with just a single `*.vue` file with the `vue serve` and `vue build` commands, but they require a global addon to be installed along with the Vue CLI:

``` bash
npm install -g @vue/cli-service-global
npm install -g @vue/cli @vue/cli-service-global
# or
yarn global add @vue/cli-service-global
yarn global add @vue/cli @vue/cli-service-global
```

The drawback of `vue serve` is that it relies on globally installed dependencies which may be inconsistent on different machines. Therefore this is only recommended for rapid prototyping.
Expand Down
4 changes: 4 additions & 0 deletions docs/guide/webpack.md
Expand Up @@ -81,6 +81,10 @@ module.exports = {
.use('graphql-tag/loader')
.loader('graphql-tag/loader')
.end()
// Add another loader
.use('other-loader')
.loader('other-loader')
.end()
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/migrating-from-v3/README.md
Expand Up @@ -266,7 +266,7 @@ As in the cypress plugin, the support for legacy `vue-cli-service e2e` command h

### `@vue/cli-plugin-typescript`

When using Typescript, the webpack resolve options now [prefer `ts(x)` file extensions over `js(x)` ones](https://github.com/vuejs/vue-cli/pull/3909).
When importing a file without extension, the webpack resolve options now [prefer `.ts(x)` files over `.js(x)` and `.vue` ones](https://github.com/vuejs/vue-cli/pull/3909). We strongly recommend you to always include the file extension when importing `.vue` files.

### `@vue/cli-plugin-unit-jest`

Expand Down
4 changes: 2 additions & 2 deletions docs/ru/guide/cli-service.md
Expand Up @@ -51,7 +51,7 @@ npx vue-cli-service serve
--port определить порт (по умолчанию: 8080)
--https использовать https (по умолчанию: false)
--public указать URL-адрес публичной сети для клиента HMR
--skip-plugins имёна плагинов через запятую, которые следует пропустить при запуске
--skip-plugins имена плагинов через запятую, которые следует пропустить при запуске
```

::: tip --copy
Expand Down Expand Up @@ -83,7 +83,7 @@ npx vue-cli-service serve
--no-clean не удалять каталог dist перед сборкой проекта
--report сгенерировать report.html для анализа содержимого сборки
--report-json сгенерировать report.json для анализа содержимого сборки
--skip-plugins имёна плагинов через запятую, которые следует пропустить при запуске
--skip-plugins имена плагинов через запятую, которые следует пропустить при запуске
--watch отслеживать изменения
```

Expand Down
6 changes: 3 additions & 3 deletions docs/ru/guide/prototyping.md
@@ -1,11 +1,11 @@
# Мгновенное прототипирование

Вы можете быстро создавать прототип в одном файле `*.vue` с помощью команд `vue serve` и `vue build`, но для них сначала потребуется глобально установить дополнительный плагин:
Вы можете быстро создавать прототип в одном файле `*.vue` с помощью команд `vue serve` и `vue build`, но для них сначала потребуется глобально установить плагин в дополнение к Vue CLI:

```bash
npm install -g @vue/cli-service-global
npm install -g @vue/cli @vue/cli-service-global
# или
yarn global add @vue/cli-service-global
yarn global add @vue/cli @vue/cli-service-global
```

Недостаток `vue serve` в том, что он полагается на глобально установленные зависимости, которые могут отличаться на разных машинах. Поэтому его рекомендуется использовать только для быстрого прототипирования.
Expand Down
4 changes: 4 additions & 0 deletions docs/ru/guide/webpack.md
Expand Up @@ -81,6 +81,10 @@ module.exports = {
.use('graphql-tag/loader')
.loader('graphql-tag/loader')
.end()
// Добавление ещё одного загрузчика
.use('other-loader')
.loader('other-loader')
.end()
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/ru/migrating-from-v3/README.md
Expand Up @@ -261,7 +261,7 @@ Nightwatch.js обновлён с версии 0.9 до 1.x. Рекоменду

### `@vue/cli-plugin-typescript`

При использовании Typescript, webpack в настройках разрешения модулей теперь [отдаёт предпочтение файлам с расширениями `ts(x)`, а не `js(x)`](https://github.com/vuejs/vue-cli/pull/3909).
При импорте файла без расширения, настройки webpack по разрешению модулей теперь [отдают предпочтение файлам с расширениями `ts(x)` вместо `js(x)` и `.vue`](https://github.com/vuejs/vue-cli/pull/3909). Настоятельно рекомендуется всегда указывать расширение файла при импорте `.vue` файлов.

### `@vue/cli-plugin-unit-jest`

Expand Down
4 changes: 2 additions & 2 deletions docs/zh/guide/browser-compatibility.md
Expand Up @@ -38,13 +38,13 @@
我们推荐以这种方式添加 polyfill 而不是在源代码中直接导入它们,因为如果这里列出的 polyfill 在 `browserslist` 的目标中不需要,则它会被自动排除。
:::

3. **如果该依赖交付 ES5 代码,但使用了 ES6+ 特性且没有显式地列出需要的 polyfill (例如 Vuetify):**请使用 `useBuiltIns: 'entry'` 然后在入口文件添加 `import '@babel/polyfill'`。这会根据 `browserslist` 目标导入**所有** polyfill,这样你就不用再担心依赖的 polyfill 问题了,但是因为包含了一些没有用到的 polyfill 所以最终的包大小可能会增加。
3. **如果该依赖交付 ES5 代码,但使用了 ES6+ 特性且没有显式地列出需要的 polyfill (例如 Vuetify):**请使用 `useBuiltIns: 'entry'` 然后在入口文件添加 `import 'core-js/stable'; import 'regenerator-runtime/runtime';`。这会根据 `browserslist` 目标导入**所有** polyfill,这样你就不用再担心依赖的 polyfill 问题了,但是因为包含了一些没有用到的 polyfill 所以最终的包大小可能会增加。

更多细节可查阅 [@babel-preset/env 文档](https://new.babeljs.io/docs/en/next/babel-preset-env.html#usebuiltins-usage)

### 构建库或是 Web Component 时的 Polyfills

当使用 Vue CLI 来[构建一个库或是 Web Component](./build-targets.md) 时,推荐给 `@vue/babel-preset-env` 传入 `useBuiltIns: false` 选项。这能够确保你的库或是组件不包含不必要的 polyfills。通常来说,打包 polyfills 应当是最终使用你的库的应用的责任。
当使用 Vue CLI 来[构建一个库或是 Web Component](./build-targets.md) 时,推荐给 `@vue/babel-preset-app` 传入 `useBuiltIns: false` 选项。这能够确保你的库或是组件不包含不必要的 polyfills。通常来说,打包 polyfills 应当是最终使用你的库的应用的责任。

## 现代模式

Expand Down
4 changes: 2 additions & 2 deletions docs/zh/guide/cli-service.md
Expand Up @@ -136,9 +136,9 @@ npx vue-cli-service help [command]
}
```

::: warning

`yorkie` fork 自 [`husky`](https://github.com/typicode/husky) 且与后者不兼容。
:::


## 配置时无需 Eject

Expand Down
4 changes: 4 additions & 0 deletions docs/zh/guide/webpack.md
Expand Up @@ -81,6 +81,10 @@ module.exports = {
.use('graphql-tag/loader')
.loader('graphql-tag/loader')
.end()
// 你还可以再添加一个 loader
.use('other-loader')
.loader('other-loader')
.end()
}
}
```
Expand Down

0 comments on commit 33779ac

Please sign in to comment.