Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.4.0
Choose a base ref
...
head repository: vuejs/vue-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.4.1
Choose a head ref

Commits on Jan 11, 2019

  1. Copy the full SHA
    e401a81 View commit details

Commits on Jan 24, 2019

  1. docs: update text on cli-service.md (#3360) [ci skip]

    Changed word allows from 3rd person present.
    tinywook authored and haoqunjiang committed Jan 24, 2019
    Copy the full SHA
    3a1b1d8 View commit details

Commits on Jan 29, 2019

  1. docs: add documentation for --formats to the build options section (#…

    …3386) [ci skip]
    
    Pull #2583 added --formats to the cli build commands but did not add documentation to the guide for the flag
    zigzaggin authored and haoqunjiang committed Jan 29, 2019
    Copy the full SHA
    8568232 View commit details

Commits on Jan 30, 2019

  1. Copy the full SHA
    3d0d16a View commit details

Commits on Jan 31, 2019

  1. Copy the full SHA
    4dfab99 View commit details
  2. Copy the full SHA
    cfed026 View commit details

Commits on Feb 2, 2019

  1. Copy the full SHA
    5edd928 View commit details

Commits on Feb 4, 2019

  1. fix: fix hash difference on different terminal sessions

    This reverts commit 047872c.
    Fixes #3416.
    haoqunjiang committed Feb 4, 2019
    3
    Copy the full SHA
    a2bc927 View commit details

Commits on Feb 7, 2019

  1. Copy the full SHA
    67ce6a2 View commit details
  2. Copy the full SHA
    ff87547 View commit details
  3. Copy the full SHA
    45dcbc5 View commit details
  4. chore: add repository.directory field to each package.json to spe…

    …cify where each package lives in a monorepo (#3397)
    visualfanatic authored and haoqunjiang committed Feb 7, 2019
    Copy the full SHA
    87f9a29 View commit details

Commits on Feb 8, 2019

  1. Copy the full SHA
    43bee4e View commit details

Commits on Feb 13, 2019

  1. Copy the full SHA
    38aa8d9 View commit details

Commits on Feb 17, 2019

  1. Copy the full SHA
    f819f51 View commit details
  2. fix(cli-plugin-eslint): make eslint deps optional (#3068)

    1. In @vue/cli-plugin-eslint 3.1.0+, eslint will be explicitly added to
    the project's package.json, so it is **optional**.
    2. `optionalDependencies` will still be installed by npm by default,
    just no longer cause installation to fail when error happens.
    3. ESLint v4 did cause weird errors sometimes, like `npm WARN
    ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed.`
    Though this warning never caused any errors on my machine, I think it's
    good to make the plugin fail-safe.
    haoqunjiang authored Feb 17, 2019
    Copy the full SHA
    114313c View commit details

Commits on Feb 18, 2019

  1. 1
    Copy the full SHA
    225b558 View commit details
  2. chore: update deps

    haoqunjiang committed Feb 18, 2019
    Copy the full SHA
    fccb114 View commit details
  3. Copy the full SHA
    364f28f View commit details
  4. Copy the full SHA
    bf59e4f View commit details

Commits on Feb 19, 2019

  1. 1
    Copy the full SHA
    ea5d9f7 View commit details

Commits on Feb 20, 2019

  1. Copy the full SHA
    1b27d02 View commit details
  2. Copy the full SHA
    e0983f4 View commit details
  3. Copy the full SHA
    805a4ce View commit details
  4. v3.4.1

    haoqunjiang committed Feb 20, 2019
    Copy the full SHA
    0c3f618 View commit details
Showing with 389 additions and 195 deletions.
  1. +93 −0 CHANGELOG.md
  2. +3 −3 docs/.vuepress/config.js
  3. BIN docs/.vuepress/public/cli-new-project.png
  4. BIN docs/.vuepress/public/cli-select-features.png
  5. +1 −1 docs/dev-guide/plugin-dev.md
  6. +1 −1 docs/dev-guide/ui-api.md
  7. +1 −1 docs/dev-guide/ui-info.md
  8. +2 −1 docs/guide/cli-service.md
  9. +3 −3 docs/guide/creating-a-project.md
  10. +2 −0 docs/guide/mode-and-env.md
  11. +2 −0 docs/guide/prototyping.md
  12. +1 −1 docs/ru/dev-guide/ui-api.md
  13. +1 −1 docs/ru/dev-guide/ui-info.md
  14. +1 −1 docs/ru/guide/creating-a-project.md
  15. +2 −2 docs/zh/dev-guide/ui-api.md
  16. +1 −1 docs/zh/dev-guide/ui-info.md
  17. +3 −3 docs/zh/guide/creating-a-project.md
  18. +1 −1 lerna.json
  19. +4 −3 packages/@vue/babel-preset-app/package.json
  20. +3 −2 packages/@vue/cli-init/package.json
  21. +3 −2 packages/@vue/cli-overlay/package.json
  22. +1 −0 packages/@vue/cli-plugin-babel/index.js
  23. +5 −4 packages/@vue/cli-plugin-babel/package.json
  24. +4 −3 packages/@vue/cli-plugin-e2e-cypress/package.json
  25. +6 −5 packages/@vue/cli-plugin-e2e-nightwatch/package.json
  26. +1 −1 packages/@vue/cli-plugin-eslint/lint.js
  27. +9 −6 packages/@vue/cli-plugin-eslint/package.json
  28. +4 −3 packages/@vue/cli-plugin-pwa/package.json
  29. +25 −0 packages/@vue/cli-plugin-typescript/__tests__/tsPluginTSLint.spec.js
  30. +2 −1 packages/@vue/cli-plugin-typescript/index.js
  31. +9 −2 packages/@vue/cli-plugin-typescript/lib/tslint.js
  32. +4 −3 packages/@vue/cli-plugin-typescript/package.json
  33. +6 −5 packages/@vue/cli-plugin-unit-jest/package.json
  34. +4 −3 packages/@vue/cli-plugin-unit-mocha/package.json
  35. +11 −8 packages/@vue/cli-service-global/package.json
  36. +4 −0 packages/@vue/cli-service/__tests__/modernMode.spec.js
  37. +18 −1 packages/@vue/cli-service/__tests__/multiPage.spec.js
  38. +1 −1 packages/@vue/cli-service/generator/index.js
  39. +10 −2 packages/@vue/cli-service/lib/PluginAPI.js
  40. +2 −2 packages/@vue/cli-service/lib/Service.js
  41. +23 −14 packages/@vue/cli-service/lib/commands/build/index.js
  42. +18 −4 packages/@vue/cli-service/lib/commands/serve.js
  43. +0 −36 packages/@vue/cli-service/lib/util/loadEnv.js
  44. +11 −9 packages/@vue/cli-service/package.json
  45. +3 −2 packages/@vue/cli-shared-utils/package.json
  46. +3 −2 packages/@vue/cli-test-utils/package.json
  47. +9 −4 packages/@vue/cli-ui-addon-webpack/package.json
  48. +9 −4 packages/@vue/cli-ui-addon-widgets/package.json
  49. +11 −6 packages/@vue/cli-ui/package.json
  50. +2 −2 packages/@vue/cli-ui/src/i18n.js
  51. +3 −2 packages/@vue/cli-upgrade/package.json
  52. +7 −6 packages/@vue/cli/package.json
  53. +2 −1 packages/@vue/eslint-config-airbnb/package.json
  54. +3 −2 packages/@vue/eslint-config-prettier/package.json
  55. +2 −1 packages/@vue/eslint-config-standard/package.json
  56. +2 −1 packages/@vue/eslint-config-typescript/package.json
  57. +21 −21 packages/vue-cli-version-marker/package.json
  58. +1 −1 scripts/release.js
  59. +5 −0 yarn.lock
93 changes: 93 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
# [3.4.0](https://github.com/vuejs/vue-cli/compare/v3.3.0...v3.4.0) (2019-01-31)

## babel-preset-app

#### Features

* **babel:** include es6.object.assign by default ([#3281](https://github.com/vuejs/vue-cli/issues/3281)) ([8dcfc18](https://github.com/vuejs/vue-cli/commit/8dcfc18))
* expose `absoluteRuntime` option, closes [#2807](https://github.com/vuejs/vue-cli/issues/2807) ([d5ed280](https://github.com/vuejs/vue-cli/commit/d5ed280))

## cli

#### Bug Fixes

* fix injectImports when there's no pre-existing import declarations ([108d801](https://github.com/vuejs/vue-cli/commit/108d801)), closes [#2925](https://github.com/vuejs/vue-cli/issues/2925)
* should check yarn when no pacakage manager specified ([6a75056](https://github.com/vuejs/vue-cli/commit/6a75056)), closes [#3393](https://github.com/vuejs/vue-cli/issues/3393)

## cli-plugin-babel

#### Bug Fixes

* add webpack to plugins' dependencies, fix yarn peer dep warnings ([6e5e117](https://github.com/vuejs/vue-cli/commit/6e5e117))
* **cli-plugin-babel:** transpileDependencies should only match packages inside `node_modules`, close [#3057](https://github.com/vuejs/vue-cli/issues/3057) ([#3229](https://github.com/vuejs/vue-cli/issues/3229)) ([fb71653](https://github.com/vuejs/vue-cli/commit/fb71653))
* take all env variables into account in `genCacheConfig` ([047872c](https://github.com/vuejs/vue-cli/commit/047872c)), closes [#3275](https://github.com/vuejs/vue-cli/issues/3275)

## cli-plugin-eslint

#### Bug Fixes

* only add custom ignorePattern when no .eslintignore exists ([#3325](https://github.com/vuejs/vue-cli/issues/3325)) ([febd386](https://github.com/vuejs/vue-cli/commit/febd386)), closes [#3243](https://github.com/vuejs/vue-cli/issues/3243)
#### Features

* add `--no-fix-warnings` option ([#3307](https://github.com/vuejs/vue-cli/issues/3307)) ([2b6dba3](https://github.com/vuejs/vue-cli/commit/2b6dba3))

## cli-plugin-typescript

#### Bug Fixes

* fix linting of tsx script in .vue file ([#3097](https://github.com/vuejs/vue-cli/issues/3097)) ([f3fe8b3](https://github.com/vuejs/vue-cli/commit/f3fe8b3))
#### Features

* support yml, yaml and json tslint configuration files ([#3305](https://github.com/vuejs/vue-cli/issues/3305)) ([596a49d](https://github.com/vuejs/vue-cli/commit/596a49d))

## cli-plugin-unit-mocha

#### Bug Fixes

* apply a workaround for the prettier / jsdom-global bug ([bca6edc](https://github.com/vuejs/vue-cli/commit/bca6edc))

## cli-service

#### Bug Fixes

* add [@vue](https://github.com/vue)/component-compiler-utils to dependencies, fix yarn pnp compatibility ([3d6eab9](https://github.com/vuejs/vue-cli/commit/3d6eab9))
* copy `publicPath` option to `baseUrl`, fix plugin compatibility ([27ffd28](https://github.com/vuejs/vue-cli/commit/27ffd28))
* do not add link tag to demo page when css extract is false ([#3351](https://github.com/vuejs/vue-cli/issues/3351)) ([9029ad1](https://github.com/vuejs/vue-cli/commit/9029ad1))
* fix reference of friendly-errors-webpack-plugin in config ([486a921](https://github.com/vuejs/vue-cli/commit/486a921))
* genCacheConfig return different result because linebreak ([#3372](https://github.com/vuejs/vue-cli/issues/3372)) ([ab13dfe](https://github.com/vuejs/vue-cli/commit/ab13dfe))
* pin webpack version, fixes [#3335](https://github.com/vuejs/vue-cli/issues/3335) ([0a0a65f](https://github.com/vuejs/vue-cli/commit/0a0a65f))
* should respect root `parallel` option in terser plugin ([702a2c9](https://github.com/vuejs/vue-cli/commit/702a2c9))
* use a custom fork of friendly-errors-webpack-plugin ([28933c8](https://github.com/vuejs/vue-cli/commit/28933c8)), closes [/github.com/geowarin/friendly-errors-webpack-plugin/pull/82#issuecomment-454808535](https://github.com//github.com/geowarin/friendly-errors-webpack-plugin/pull/82/issues/issuecomment-454808535) [#2244](https://github.com/vuejs/vue-cli/issues/2244) [#3003](https://github.com/vuejs/vue-cli/issues/3003)
* use the correct size unit (KiB) ([1553757](https://github.com/vuejs/vue-cli/commit/1553757)), closes [#3283](https://github.com/vuejs/vue-cli/issues/3283)
#### Features

* add typings for vue.config.js options ([#3387](https://github.com/vuejs/vue-cli/issues/3387)) ([b61ea45](https://github.com/vuejs/vue-cli/commit/b61ea45))
* support dart-sass as default sass implementation ([#3321](https://github.com/vuejs/vue-cli/issues/3321)) ([9c1e797](https://github.com/vuejs/vue-cli/commit/9c1e797))
* support use -h show detailed usage of command ([67cff95](https://github.com/vuejs/vue-cli/commit/67cff95))

## cli-shared-utils

#### Bug Fixes

* add timeout for requests ([09be0f2](https://github.com/vuejs/vue-cli/commit/09be0f2)), closes [#3076](https://github.com/vuejs/vue-cli/issues/3076)

## cli-ui

#### Bug Fixes

* **cli-ui:** folder list when root windows ([#3331](https://github.com/vuejs/vue-cli/issues/3331)) ([d047aca](https://github.com/vuejs/vue-cli/commit/d047aca))
#### Features

* **ui:** enforce package.json npm rules ([#3232](https://github.com/vuejs/vue-cli/issues/3232)) ([11d17d9](https://github.com/vuejs/vue-cli/commit/11d17d9))

## eslint-config-typescript

#### Bug Fixes

* force enable `jsx` in parserOptions, fixes [#3268](https://github.com/vuejs/vue-cli/issues/3268) ([85c5973](https://github.com/vuejs/vue-cli/commit/85c5973))
#### Features

* update eslint-config-typescript to use [@typescript-eslint](https://github.com/typescript-eslint) ([#3359](https://github.com/vuejs/vue-cli/issues/3359)) ([189ea54](https://github.com/vuejs/vue-cli/commit/189ea54))



# [3.3.0](https://github.com/vuejs/vue-cli/compare/v3.2.3...v3.3.0) (2019-01-08)

## babel-preset-app
6 changes: 3 additions & 3 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -2,17 +2,17 @@ module.exports = {
locales: {
'/': {
lang: 'en-US',
title: 'Vue CLI 3',
title: 'Vue CLI',
description: '🛠️ Standard Tooling for Vue.js Development'
},
'/zh/': {
lang: 'zh-CN',
title: 'Vue CLI 3',
title: 'Vue CLI',
description: '🛠️ Vue.js 开发的标准工具'
},
'/ru/': {
lang: 'ru',
title: 'Vue CLI 3',
title: 'Vue CLI',
description: '🛠️ Стандартный инструментарий для разработки на Vue.js'
}
},
Binary file modified docs/.vuepress/public/cli-new-project.png

Unable to render rich display

Invalid image source.

Binary file modified docs/.vuepress/public/cli-select-features.png

Unable to render rich display

Invalid image source.

2 changes: 1 addition & 1 deletion docs/dev-guide/plugin-dev.md
Original file line number Diff line number Diff line change
@@ -781,7 +781,7 @@ Example:
{
"name": "vue-cli-plugin-apollo",
"version": "0.7.7",
"description": "vue-cli 3 plugin to add Apollo and GraphQL"
"description": "vue-cli plugin to add Apollo and GraphQL"
}
```

2 changes: 1 addition & 1 deletion docs/dev-guide/ui-api.md
Original file line number Diff line number Diff line change
@@ -628,7 +628,7 @@ A Client addon is a JS bundle which is dynamically loaded into the cli-ui. It is

### Create a client addon

The recommended way to create a Client addon is by creating a new project using vue-cli 3. You can either do this in a subfolder of your plugin or in a different npm package.
The recommended way to create a Client addon is by creating a new project using vue cli. You can either do this in a subfolder of your plugin or in a different npm package.

Install `@vue/cli-ui` as a dev dependency.

2 changes: 1 addition & 1 deletion docs/dev-guide/ui-info.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ Example:
{
"name": "vue-cli-plugin-apollo",
"version": "0.7.7",
"description": "vue-cli 3 plugin to add Apollo and GraphQL"
"description": "vue-cli plugin to add Apollo and GraphQL"
}
```

3 changes: 2 additions & 1 deletion docs/guide/cli-service.md
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ Options:
--dest specify output directory (default: dist)
--modern build app targeting modern browsers with auto fallback
--target app | lib | wc | wc-async (default: app)
--formats list of output formats for library builds (default: commonjs,umd,umd-min)
--name name for lib or web-component mode (default: "name" in package.json or entry filename)
--no-clean do not remove the dist directory before building the project
--report generate report.html to help analyze bundle content
@@ -136,4 +137,4 @@ When installed, `@vue/cli-service` also installs [yorkie](https://github.com/yyx

Projects created via `vue create` are ready to go without the need for additional configuration. The plugins are designed to work with one another so in most cases, all you need to do is pick the features you want during the interactive prompts.

However, we also understand that it's impossible to cater to every possible need, and the need of a project may also change over time. Projects created by Vue CLI allows you to configure almost every aspect of the tooling without ever needing to eject. Check out the [Config Reference](../config/) for more details.
However, we also understand that it's impossible to cater to every possible need, and the need of a project may also change over time. Projects created by Vue CLI allow you to configure almost every aspect of the tooling without ever needing to eject. Check out the [Config Reference](../config/) for more details.
6 changes: 3 additions & 3 deletions docs/guide/creating-a-project.md
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ vue create hello-world

::: warning
If you are on Windows using Git Bash with minTTY, the interactive prompts will not work. You must launch the command as `winpty vue.cmd create hello-world`.
If you however want to still use the `vue create hello-world` syntax, you can alias the command by adding the following line to your `~/.bashrc` file.
`alias vue='winpty vue.cmd'`
If you however want to still use the `vue create hello-world` syntax, you can alias the command by adding the following line to your `~/.bashrc` file.
`alias vue='winpty vue.cmd'`
You will need to restart your Git Bash terminal session to pull in the updated bashrc file.
:::

@@ -73,7 +73,7 @@ The above command will open a browser window with a GUI that guides you through

## Pulling 2.x Templates (Legacy)

Vue CLI 3 uses the same `vue` binary, so it overwrites Vue CLI 2 (`vue-cli`). If you still need the legacy `vue init` functionality, you can install a global bridge:
Vue CLI >= 3 uses the same `vue` binary, so it overwrites Vue CLI 2 (`vue-cli`). If you still need the legacy `vue init` functionality, you can install a global bridge:

``` bash
npm install -g @vue/cli-init
2 changes: 2 additions & 0 deletions docs/guide/mode-and-env.md
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@ FOO=bar
VUE_APP_SECRET=secret
```

For more detailed env parsing rules, please refer to [the documentation of `dotenv`](https://github.com/motdotla/dotenv#rules).

Loaded variables will become available to all `vue-cli-service` commands, plugins and dependencies.

::: tip Env Loading Priorities
2 changes: 2 additions & 0 deletions docs/guide/prototyping.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ You can rapidly prototype with just a single `*.vue` file with the `vue serve` a

``` bash
npm install -g @vue/cli-service-global
# or
yarn global add @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.
2 changes: 1 addition & 1 deletion docs/ru/dev-guide/ui-api.md
Original file line number Diff line number Diff line change
@@ -628,7 +628,7 @@ api.addTask({

### Создание клиентского дополнения

Рекомендуемый способ создания клиентского дополнения — создать новый проект с помощью vue-cli 3. Вы можете либо сделать это в подкаталоге вашего плагина, либо в другом npm пакете.
Рекомендуемый способ создания клиентского дополнения — создать новый проект с помощью vue cli. Вы можете либо сделать это в подкаталоге вашего плагина, либо в другом npm пакете.

Установите `@vue/cli-ui` в качестве зависимости для разработки (dev dependency).

2 changes: 1 addition & 1 deletion docs/ru/dev-guide/ui-info.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
{
"name": "vue-cli-plugin-apollo",
"version": "0.7.7",
"description": "vue-cli 3 plugin to add Apollo and GraphQL"
"description": "vue-cli plugin to add Apollo and GraphQL"
}
```

2 changes: 1 addition & 1 deletion docs/ru/guide/creating-a-project.md
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ vue ui

## Шаблоны для версии 2.x (старое поведение)

Vue CLI 3 использует команду `vue`, поэтому он перезаписывает Vue CLI 2 (`vue-cli`). Если вам по-прежнему необходимо старое поведение и функциональность команды `vue init`, нужно лишь установить глобально дополнительный плагин `@vue/cli-init`:
Vue CLI >= 3 использует команду `vue`, поэтому он перезаписывает Vue CLI 2 (`vue-cli`). Если вам по-прежнему необходимо старое поведение и функциональность команды `vue init`, нужно лишь установить глобально дополнительный плагин `@vue/cli-init`:

``` bash
npm install -g @vue/cli-init
4 changes: 2 additions & 2 deletions docs/zh/dev-guide/ui-api.md
Original file line number Diff line number Diff line change
@@ -626,7 +626,7 @@ api.addTask({

### 创建一个客户端 addon

推荐的创建一个客户端 addon 的方式是通过 vue-cli 3 创建一个新项目。你也可以在插件的子目录或不同的 npm 包中这样做。
推荐的创建一个客户端 addon 的方式是通过 vue cli 创建一个新项目。你也可以在插件的子目录或不同的 npm 包中这样做。

作为开发依赖安装 `@vue/cli-ui`

@@ -1338,7 +1338,7 @@ api.getProject()

你可能需要在 cli-ui 内建的 HTTP 服务器上暴露一些静态文件 (通常是为自定义视图指定图标)。

在插件包跟目录里可选的放置一个 `ui-public` 文件夹,这个文件夹里的任何文件都会暴露至 `/_plugin/:id/*` 的 HTTP 路由。
在插件包根目录里可选的放置一个 `ui-public` 文件夹,这个文件夹里的任何文件都会暴露至 `/_plugin/:id/*` 的 HTTP 路由。

例如,如果你将 `my-logo.png` 文件放置到 `vue-cli-plugin-hello/ui-public/` 文件夹,那么 cli-ui 加载插件的时候可以通过 `/_plugin/vue-cli-plugin-hello/my-logo.png` 这个 URL 来访问它。

2 changes: 1 addition & 1 deletion docs/zh/dev-guide/ui-info.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
{
"name": "vue-cli-plugin-apollo",
"version": "0.7.7",
"description": "vue-cli 3 plugin to add Apollo and GraphQL"
"description": "vue cli plugin to add Apollo and GraphQL"
}
```

6 changes: 3 additions & 3 deletions docs/zh/guide/creating-a-project.md
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ vue create hello-world
```

::: warning 警告
如果你在 Windows 上通过 minTTY 使用 Git Bash,交互提示符并不工作。你必须通过 `winpty vue.cmd create hello-world` 启动这个命令。不过,如果你仍想使用 `vue create hello-world`,则可以通过在 `~/.bashrc` 文件中添加以下行来为命令添加别名。
`alias vue='winpty vue.cmd'`
如果你在 Windows 上通过 minTTY 使用 Git Bash,交互提示符并不工作。你必须通过 `winpty vue.cmd create hello-world` 启动这个命令。不过,如果你仍想使用 `vue create hello-world`,则可以通过在 `~/.bashrc` 文件中添加以下行来为命令添加别名。
`alias vue='winpty vue.cmd'`
你需要重新启动 Git Bash 终端会话以使更新后的 bashrc 文件生效。
:::

@@ -72,7 +72,7 @@ vue ui

## 拉取 2.x 模板 (旧版本)

Vue CLI 3 和旧版使用了相同的 `vue` 命令,所以 Vue CLI 2 (`vue-cli`) 被覆盖了。如果你仍然需要使用旧版本的 `vue init` 功能,你可以全局安装一个桥接工具:
Vue CLI >= 3 和旧版使用了相同的 `vue` 命令,所以 Vue CLI 2 (`vue-cli`) 被覆盖了。如果你仍然需要使用旧版本的 `vue init` 功能,你可以全局安装一个桥接工具:

``` bash
npm install -g @vue/cli-init
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"npmClient": "yarn",
"useWorkspaces": false,
"version": "3.4.0",
"version": "3.4.1",
"packages": [
"packages/@vue/babel-preset-app",
"packages/@vue/cli*"
7 changes: 4 additions & 3 deletions packages/@vue/babel-preset-app/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@vue/babel-preset-app",
"version": "3.4.0",
"version": "3.4.1",
"description": "babel-preset-app for vue-cli",
"main": "index.js",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/babel-preset-app"
},
"keywords": [
"vue",
@@ -31,6 +32,6 @@
"@babel/runtime-corejs2": "^7.2.0",
"@vue/babel-preset-jsx": "^1.0.0-beta.2",
"babel-plugin-dynamic-import-node": "^2.2.0",
"core-js": "^2.6.3"
"core-js": "^2.6.5"
}
}
5 changes: 3 additions & 2 deletions packages/@vue/cli-init/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@vue/cli-init",
"version": "3.4.0",
"version": "3.4.1",
"description": "init addon for vue-cli",
"main": "index.js",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-init"
},
"keywords": [
"vue",
5 changes: 3 additions & 2 deletions packages/@vue/cli-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@vue/cli-overlay",
"version": "3.4.0",
"version": "3.4.1",
"description": "error overlay & dev server middleware for vue-cli",
"main": "dist/client.js",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-overlay"
},
"keywords": [
"vue",
1 change: 1 addition & 0 deletions packages/@vue/cli-plugin-babel/index.js
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ module.exports = (api, options) => {
'@babel/core': require('@babel/core/package.json').version,
'@vue/babel-preset-app': require('@vue/babel-preset-app/package.json').version,
'babel-loader': require('babel-loader/package.json').version,
modern: !!process.env.VUE_CLI_MODERN_BUILD,
browserslist: api.service.pkg.browserslist
}, [
'babel.config.js',
9 changes: 5 additions & 4 deletions packages/@vue/cli-plugin-babel/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-babel",
"version": "3.4.0",
"version": "3.4.1",
"description": "babel plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-babel"
},
"keywords": [
"vue",
@@ -20,8 +21,8 @@
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
"dependencies": {
"@babel/core": "^7.0.0",
"@vue/babel-preset-app": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.0",
"@vue/babel-preset-app": "^3.4.1",
"@vue/cli-shared-utils": "^3.4.1",
"babel-loader": "^8.0.5",
"webpack": ">=4 < 4.29"
},
7 changes: 4 additions & 3 deletions packages/@vue/cli-plugin-e2e-cypress/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-e2e-cypress",
"version": "3.4.0",
"version": "3.4.1",
"description": "e2e-cypress plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-e2e-cypress"
},
"keywords": [
"vue",
@@ -22,7 +23,7 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"cypress": "^3.1.5",
"eslint-plugin-cypress": "^2.2.0"
}
11 changes: 6 additions & 5 deletions packages/@vue/cli-plugin-e2e-nightwatch/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-e2e-nightwatch",
"version": "3.4.0",
"version": "3.4.1",
"description": "e2e-nightwatch plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-e2e-nightwatch"
},
"keywords": [
"vue",
@@ -22,9 +23,9 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"chromedriver": "^2.45.0",
"deepmerge": "^3.1.0",
"@vue/cli-shared-utils": "^3.4.1",
"chromedriver": "^2.46.0",
"deepmerge": "^3.2.0",
"execa": "^1.0.0",
"nightwatch": "^0.9.21",
"selenium-server": "^3.141.59"
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-eslint/lint.js
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ module.exports = function lint (args = {}, api) {
const noFixWarningsPredicate = (lintResult) => lintResult.severity === 2
config.fix = config.fix && (noFixWarnings ? noFixWarningsPredicate : true)

if (!fs.existsSync(api.resolve('.eslintignore'))) {
if (!fs.existsSync(api.resolve('.eslintignore')) && !config.ignorePattern) {
// .eslintrc.js files (ignored by default)
// However, we need to lint & fix them so as to make the default generated project's
// code style consistent with user's selected eslint config.
15 changes: 9 additions & 6 deletions packages/@vue/cli-plugin-eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-eslint",
"version": "3.4.0",
"version": "3.4.1",
"description": "eslint plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-eslint"
},
"keywords": [
"vue",
@@ -22,12 +23,14 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"babel-eslint": "^10.0.1",
"eslint": "^4.19.1",
"eslint-loader": "^2.1.1",
"eslint-plugin-vue": "^4.7.1",
"eslint-loader": "^2.1.2",
"globby": "^9.0.0",
"webpack": ">=4 < 4.29"
},
"optionalDependencies": {
"eslint": "^4.19.1",
"eslint-plugin-vue": "^4.7.1"
}
}
7 changes: 4 additions & 3 deletions packages/@vue/cli-plugin-pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-pwa",
"version": "3.4.0",
"version": "3.4.1",
"description": "pwa plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-pwa"
},
"keywords": [
"vue",
@@ -22,7 +23,7 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"webpack": ">=4 < 4.29",
"workbox-webpack-plugin": "^3.6.3"
},
Original file line number Diff line number Diff line change
@@ -88,3 +88,28 @@ test('should ignore issues in node_modules', async () => {
await run('vue-cli-service lint')
expect(await read('node_modules/bad.ts')).toMatch(updatedMain)
})

test('should be able to fix mixed line endings', async () => {
const project = await create('ts-lint-mixed-line-endings', {
plugins: {
'@vue/cli-plugin-typescript': {
tsLint: true
}
}
})

const { write, run } = project

const b64 = 'PHRlbXBsYXRlPjwvdGVtcGxhdGU+DQoNCjxzY3JpcHQgbGFuZz0idHMiPg0KZXhwb3J0IGRlZmF1bHQgY2xhc3MgVGVzdCAgew0KICBnZXQgYXNzaWduZWUoKSB7DQogICAgdmFyIGl0ZW1zOnt0ZXh0OnN0cmluZzsgdmFsdWU6c3RyaW5nIHwgbnVtYmVyIHwgbnVsbH1bXSA9IFtdOw0KICAgIHJldHVybiBpdGVtczsNCiAgfQ0KDQp9DQo8L3NjcmlwdD4NCg0K'
const buf = Buffer.from(b64, 'base64')

await write('src/bad.vue', buf)

// Try twice to fix the file.
// For now, it will fail the first time, which corresponds to the behaviour of tslint.
try {
await run('vue-cli-service lint -- src/bad.vue')
} catch (e) { }

await run('vue-cli-service lint -- src/bad.vue')
})
3 changes: 2 additions & 1 deletion packages/@vue/cli-plugin-typescript/index.js
Original file line number Diff line number Diff line change
@@ -30,7 +30,8 @@ module.exports = (api, options) => {
loader: 'cache-loader',
options: api.genCacheConfig('ts-loader', {
'ts-loader': require('ts-loader/package.json').version,
'typescript': require('typescript/package.json').version
'typescript': require('typescript/package.json').version,
modern: !!process.env.VUE_CLI_MODERN_BUILD
}, 'tsconfig.json')
})

11 changes: 9 additions & 2 deletions packages/@vue/cli-plugin-typescript/lib/tslint.js
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ module.exports = function lint (args = {}, api, silent) {
if (isVueFile(file)) {
const parts = vueFileCache.get(path.normalize(file))
if (parts) {
parts.content = content
const { before, after } = parts
content = `${before}\n${content.trim()}\n${after}`
}
@@ -42,12 +43,18 @@ module.exports = function lint (args = {}, api, silent) {
}

const parseTSFromVueFile = file => {
// If the file has already been cached, don't read the file again. Use the cache instead.
if (vueFileCache.has(file)) {
return vueFileCache.get(file)
}

const content = fs.readFileSync(file, 'utf-8')
const { script } = vueCompiler.parseComponent(content, { pad: 'line' })
if (script && /^tsx?$/.test(script.lang)) {
vueFileCache.set(file, {
before: content.slice(0, script.start),
after: content.slice(script.end)
after: content.slice(script.end),
content: script.content
})
return script
}
@@ -62,7 +69,7 @@ module.exports = function lint (args = {}, api, silent) {
program.getSourceFile = function (file, languageVersion, onError) {
if (isVueFile(file)) {
const { content, lang = 'js' } = parseTSFromVueFile(file) || { content: '', lang: 'js' }
const contentLang = ts.ScriptKind[lang.toUpperCase()];
const contentLang = ts.ScriptKind[lang.toUpperCase()]
return ts.createSourceFile(file, content, languageVersion, true, contentLang)
} else {
return getSourceFile.call(this, file, languageVersion, onError)
7 changes: 4 additions & 3 deletions packages/@vue/cli-plugin-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-typescript",
"version": "3.4.0",
"version": "3.4.1",
"description": "typescript plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-typescript"
},
"keywords": [
"vue",
@@ -23,7 +24,7 @@
},
"dependencies": {
"@types/webpack-env": "^1.13.6",
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"globby": "^9.0.0",
"ts-loader": "^5.3.3",
11 changes: 6 additions & 5 deletions packages/@vue/cli-plugin-unit-jest/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-unit-jest",
"version": "3.4.0",
"version": "3.4.1",
"description": "unit-jest plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-unit-jest"
},
"keywords": [
"vue",
@@ -22,13 +23,13 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"babel-jest": "^23.6.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"jest": "^23.6.0",
"jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^1.0.0",
"vue-jest": "^3.0.2"
"jest-transform-stub": "^2.0.0",
"vue-jest": "^3.0.3"
},
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.20",
7 changes: 4 additions & 3 deletions packages/@vue/cli-plugin-unit-mocha/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-plugin-unit-mocha",
"version": "3.4.0",
"version": "3.4.1",
"description": "mocha unit testing plugin for vue-cli",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-plugin-unit-mocha"
},
"keywords": [
"vue",
@@ -21,7 +22,7 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"jsdom": "^13.2.0",
"jsdom-global": "^3.0.2",
"mocha": "^5.2.0",
19 changes: 11 additions & 8 deletions packages/@vue/cli-service-global/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@vue/cli-service-global",
"version": "3.4.0",
"version": "3.4.1",
"description": "vue-cli-service global addon for vue-cli",
"main": "index.js",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-service-global"
},
"keywords": [
"vue",
@@ -21,14 +22,16 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-build#readme",
"dependencies": {
"@vue/babel-preset-app": "^3.4.0",
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"@vue/babel-preset-app": "^3.4.1",
"@vue/cli-plugin-babel": "^3.4.1",
"@vue/cli-plugin-eslint": "^3.4.1",
"@vue/cli-service": "^3.4.1",
"babel-eslint": "^10.0.1",
"chalk": "^2.4.2",
"eslint": "^4.19.1",
"eslint-plugin-vue": "^4.7.1",
"resolve": "^1.10.0",
"vue": "^2.5.22",
"vue-template-compiler": "^2.5.22"
"vue": "^2.6.6",
"vue-template-compiler": "^2.6.6"
}
}
4 changes: 4 additions & 0 deletions packages/@vue/cli-service/__tests__/modernMode.spec.js
Original file line number Diff line number Diff line change
@@ -22,6 +22,10 @@ test('modern mode', async () => {
expect(files.some(f => /^chunk-vendors\.\w{8}\.js$/.test(f))).toBe(true)
expect(files.some(f => /^chunk-vendors-legacy\.\w{8}\.js$/.test(f))).toBe(true)

// arrow function should be reserved in the modern build
const app = await project.read(`dist/js/${files.find(f => /^app\.\w{8}\.js$/.test(f))}`)
expect(app).toMatch(/=>/)

// assert correct asset links
const index = await project.read('dist/index.html')

19 changes: 18 additions & 1 deletion packages/@vue/cli-service/__tests__/multiPage.spec.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@ async function makeProjectMultiPage (project) {
pages: {
index: { entry: 'src/main.js' },
foo: { entry: 'src/foo.js' },
bar: { entry: 'src/bar.js' }
bar: { entry: 'src/bar.js' },
foobar: { entry: 'src/foobar.js' }
},
chainWebpack: config => {
const splitOptions = config.optimization.get('splitChunks')
@@ -39,6 +40,13 @@ async function makeProjectMultiPage (project) {
render: h => h(App)
})
`)
await project.write('src/foobar.js', `
import Vue from 'vue'
new Vue({
el: '#app',
render: h => h('h1', 'FooBar')
})
`)
const app = await project.read('src/App.vue')
await project.write('src/App.vue', app.replace(
`import HelloWorld from './components/HelloWorld.vue'`,
@@ -61,6 +69,15 @@ test('serve w/ multi page', async () => {

await page.goto(`${url}/bar.html`)
expect(await helpers.getText('h1')).toMatch(`Welcome to Your Vue.js App`)

await page.goto(`${url}foo`)
expect(await helpers.getText('h1')).toMatch(`Foo`)

await page.goto(`${url}bar`)
expect(await helpers.getText('h1')).toMatch(`Welcome to Your Vue.js App`)

await page.goto(`${url}foobar`)
expect(await helpers.getText('h1')).toMatch(`FooBar`)
}
)
})
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/generator/index.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ module.exports = (api, options) => {
'build': 'vue-cli-service build'
},
dependencies: {
'vue': '^2.5.22'
'vue': '^2.6.6'
},
devDependencies: {
'vue-template-compiler': '^2.5.21'
12 changes: 10 additions & 2 deletions packages/@vue/cli-service/lib/PluginAPI.js
Original file line number Diff line number Diff line change
@@ -147,7 +147,8 @@ class PluginAPI {
partialIdentifier,
'cli-service': require('../package.json').version,
'cache-loader': require('cache-loader/package.json').version,
env: process.env,
env: process.env.NODE_ENV,
test: !!process.env.VUE_CLI_TEST,
config: [
fmtFunc(this.service.projectOptions.chainWebpack),
fmtFunc(this.service.projectOptions.configureWebpack)
@@ -158,7 +159,14 @@ class PluginAPI {
const readConfig = file => {
const absolutePath = this.resolve(file)
if (fs.existsSync(absolutePath)) {
return fs.readFileSync(absolutePath, 'utf-8')
if (absolutePath.endsWith('.js')) {
// should evaluate config scripts to reflect environment variable changes
try {
return JSON.stringify(require(absolutePath))
} catch (e) {
return fs.readFileSync(absolutePath, 'utf-8')
}
}
}
}
if (!Array.isArray(configFiles)) {
4 changes: 2 additions & 2 deletions packages/@vue/cli-service/lib/Service.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ const readPkg = require('read-pkg')
const merge = require('webpack-merge')
const Config = require('webpack-chain')
const PluginAPI = require('./PluginAPI')
const loadEnv = require('./util/loadEnv')
const dotenv = require('dotenv')
const defaultsDeep = require('lodash.defaultsdeep')
const { warn, error, isPlugin, loadModule } = require('@vue/cli-shared-utils')

@@ -95,7 +95,7 @@ module.exports = class Service {

const load = path => {
try {
const res = loadEnv(path)
const res = dotenv.config({ path, debug: process.env.DEBUG })
logger(path, res)
} catch (err) {
// only ignore error if file is not found
37 changes: 23 additions & 14 deletions packages/@vue/cli-service/lib/commands/build/index.js
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ module.exports = (api, options) => {
'--report-json': 'generate report.json to help analyze bundle content',
'--watch': `watch for changes`
}
}, async (args) => {
}, async (args, rawArgs) => {
for (const key in defaults) {
if (args[key] == null) {
args[key] = defaults[key]
@@ -50,20 +50,29 @@ module.exports = (api, options) => {
process.env.VUE_CLI_BUILD_TARGET = args.target
if (args.modern && args.target === 'app') {
process.env.VUE_CLI_MODERN_MODE = true
delete process.env.VUE_CLI_MODERN_BUILD
await build(Object.assign({}, args, {
modernBuild: false,
keepAlive: true
}), api, options)

process.env.VUE_CLI_MODERN_BUILD = true
await build(Object.assign({}, args, {
modernBuild: true,
clean: false
}), api, options)

if (!process.env.VUE_CLI_MODERN_BUILD) {
// main-process for legacy build
await build(Object.assign({}, args, {
modernBuild: false,
keepAlive: true
}), api, options)
// spawn sub-process of self for modern build
const { execa } = require('@vue/cli-shared-utils')
const cliBin = api.resolve('node_modules/.bin/vue-cli-service')
await execa(cliBin, ['build', ...rawArgs], {
stdio: 'inherit',
env: {
VUE_CLI_MODERN_BUILD: true
}
})
} else {
// sub-process for modern build
await build(Object.assign({}, args, {
modernBuild: true,
clean: false
}), api, options)
}
delete process.env.VUE_CLI_MODERN_MODE
delete process.env.VUE_CLI_MODERN_BUILD
} else {
if (args.modern) {
const { warn } = require('@vue/cli-shared-utils')
22 changes: 18 additions & 4 deletions packages/@vue/cli-service/lib/commands/serve.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ module.exports = (api, options) => {
const isProduction = process.env.NODE_ENV === 'production'

const url = require('url')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
@@ -139,9 +138,7 @@ module.exports = (api, options) => {
clientLogLevel: 'none',
historyApiFallback: {
disableDotRule: true,
rewrites: [
{ from: /./, to: path.posix.join(options.publicPath, 'index.html') }
]
rewrites: genHistoryApiFallbackRewrites(options.publicPath, options.pages)
},
contentBase: api.resolve('public'),
watchContentBase: !isProduction,
@@ -302,6 +299,23 @@ function checkInContainer () {
}
}

function genHistoryApiFallbackRewrites (baseUrl, pages = {}) {
const path = require('path')
const multiPageRewrites = Object
.keys(pages)
// sort by length in reversed order to avoid overrides
// eg. 'page11' should appear in front of 'page1'
.sort((a, b) => b.length - a.length)
.map(name => ({
from: new RegExp(`^/${name}`),
to: path.posix.join(baseUrl, pages[name].filename || `${name}.html`)
}))
return [
...multiPageRewrites,
{ from: /./, to: path.posix.join(baseUrl, 'index.html') }
]
}

module.exports.defaultModes = {
serve: 'development'
}
36 changes: 0 additions & 36 deletions packages/@vue/cli-service/lib/util/loadEnv.js

This file was deleted.

20 changes: 11 additions & 9 deletions packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-service",
"version": "3.4.0",
"version": "3.4.1",
"description": "local service for vue-cli projects",
"main": "lib/Service.js",
"typings": "types/index.d.ts",
@@ -9,7 +9,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-service"
},
"keywords": [
"vue",
@@ -24,12 +25,12 @@
"dependencies": {
"@intervolga/optimize-cssnano-plugin": "^1.0.5",
"@soda/friendly-errors-webpack-plugin": "^1.7.1",
"@vue/cli-overlay": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-overlay": "^3.4.1",
"@vue/cli-shared-utils": "^3.4.1",
"@vue/component-compiler-utils": "^2.5.2",
"@vue/preload-webpack-plugin": "^1.1.0",
"@vue/web-component-wrapper": "^1.2.0",
"acorn": "^6.0.6",
"acorn": "^6.1.0",
"acorn-walk": "^6.1.1",
"address": "^1.0.3",
"autoprefixer": "^9.4.7",
@@ -40,8 +41,9 @@
"cliui": "^4.1.0",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"cssnano": "^4.1.8",
"cssnano": "^4.1.10",
"debug": "^4.1.1",
"dotenv": "^6.2.0",
"escape-string-regexp": "^1.0.5",
"file-loader": "^3.0.1",
"fs-extra": "^7.0.1",
@@ -54,7 +56,7 @@
"lodash.transform": "^4.6.0",
"mini-css-extract-plugin": "^0.5.0",
"minimist": "^1.2.0",
"ora": "^3.0.0",
"ora": "^3.1.0",
"portfinder": "^1.0.20",
"postcss-loader": "^3.0.0",
"read-pkg": "^4.0.1",
@@ -63,12 +65,12 @@
"source-map-url": "^0.4.0",
"ssri": "^6.0.1",
"string.prototype.padend": "^3.0.0",
"terser-webpack-plugin": "^1.2.1",
"terser-webpack-plugin": "^1.2.2",
"thread-loader": "^2.1.2",
"url-loader": "^1.1.2",
"vue-loader": "^15.6.2",
"webpack": ">=4 < 4.29",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-bundle-analyzer": "^3.0.4",
"webpack-chain": "^4.11.0",
"webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.2.1",
5 changes: 3 additions & 2 deletions packages/@vue/cli-shared-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-shared-utils",
"version": "3.4.0",
"version": "3.4.1",
"description": "shared utilities for vue-cli packages",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-shared-utils"
},
"keywords": [
"vue",
5 changes: 3 additions & 2 deletions packages/@vue/cli-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@vue/cli-test-utils",
"version": "3.4.0",
"version": "3.4.1",
"description": "test utilities for vue-cli packages",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-test-utils"
},
"keywords": [
"vue",
13 changes: 9 additions & 4 deletions packages/@vue/cli-ui-addon-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"name": "@vue/cli-ui-addon-webpack",
"version": "3.4.0",
"version": "3.4.1",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-ui-addon-webpack"
},
"files": [
"dist",
"src"
@@ -13,9 +18,9 @@
},
"license": "MIT",
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"@vue/cli-plugin-babel": "^3.4.1",
"@vue/cli-plugin-eslint": "^3.4.1",
"@vue/cli-service": "^3.4.1",
"@vue/eslint-config-standard": "^4.0.0",
"eslint": "^5.8.0",
"stylus": "^0.54.5",
13 changes: 9 additions & 4 deletions packages/@vue/cli-ui-addon-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"name": "@vue/cli-ui-addon-widgets",
"version": "3.4.0",
"version": "3.4.1",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-ui-addon-widgets"
},
"files": [
"dist",
"src"
@@ -13,9 +18,9 @@
},
"license": "MIT",
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"@vue/cli-plugin-babel": "^3.4.1",
"@vue/cli-plugin-eslint": "^3.4.1",
"@vue/cli-service": "^3.4.1",
"@vue/eslint-config-standard": "^4.0.0",
"eslint": "^5.8.0",
"stylus": "^0.54.5",
17 changes: 11 additions & 6 deletions packages/@vue/cli-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"name": "@vue/cli-ui",
"version": "3.4.0",
"version": "3.4.1",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-ui"
},
"scripts": {
"serve": "cross-env VUE_APP_CLI_UI_URL=ws://localhost:4030/graphql VUE_APP_GRAPHQL_PORT=4030 vue-cli-service serve",
"build": "vue-cli-service build",
@@ -28,7 +33,7 @@
],
"dependencies": {
"@akryum/winattr": "^3.0.0",
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"chalk": "^2.4.1",
"clone": "^2.1.1",
"deepmerge": "^3.0.0",
@@ -56,10 +61,10 @@
"watch": "^1.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-e2e-cypress": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"@vue/cli-plugin-babel": "^3.4.1",
"@vue/cli-plugin-e2e-cypress": "^3.4.1",
"@vue/cli-plugin-eslint": "^3.4.1",
"@vue/cli-service": "^3.4.1",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/ui": "^0.5.5",
"ansi_up": "^3.0.0",
4 changes: 2 additions & 2 deletions packages/@vue/cli-ui/src/i18n.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import deepmerge from 'deepmerge'
import VueTimeago from 'vue-timeago'
import VueTimeago, { createTimeago } from 'vue-timeago'

Vue.use(VueI18n)

@@ -50,7 +50,7 @@ async function autoDetect () {
}

const dateFnsLocale = i18n.locale.toLowerCase().replace(/-/g, '_')
Vue.component('VueTimeago', VueTimeago.createTimeago({
Vue.component('VueTimeago', createTimeago({
name: 'VueTimeago',
locale: i18n.locale,
locales: {
5 changes: 3 additions & 2 deletions packages/@vue/cli-upgrade/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@vue/cli-upgrade",
"version": "3.4.0",
"version": "3.4.1",
"description": "utility to upgrade vue cli service / plugins in vue apps",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli-upgrade"
},
"keywords": [
"vue",
13 changes: 7 additions & 6 deletions packages/@vue/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@vue/cli",
"version": "3.4.0",
"version": "3.4.1",
"description": "Command line interface for rapid Vue.js development",
"bin": {
"vue": "bin/vue.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/cli"
},
"keywords": [
"vue",
@@ -23,10 +24,10 @@
"access": "public"
},
"dependencies": {
"@vue/cli-shared-utils": "^3.4.0",
"@vue/cli-ui": "^3.4.0",
"@vue/cli-ui-addon-webpack": "^3.4.0",
"@vue/cli-ui-addon-widgets": "^3.4.0",
"@vue/cli-shared-utils": "^3.4.1",
"@vue/cli-ui": "^3.4.1",
"@vue/cli-ui-addon-webpack": "^3.4.1",
"@vue/cli-ui-addon-widgets": "^3.4.1",
"chalk": "^2.4.1",
"cmd-shim": "^2.0.2",
"commander": "^2.16.0",
3 changes: 2 additions & 1 deletion packages/@vue/eslint-config-airbnb/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/eslint-config-airbnb"
},
"keywords": [
"vue",
5 changes: 3 additions & 2 deletions packages/@vue/eslint-config-prettier/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/eslint-config-prettier"
},
"keywords": [
"vue",
@@ -23,6 +24,6 @@
"dependencies": {
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-prettier": "^3.0.1",
"prettier": "^1.16.3"
"prettier": "^1.16.4"
}
}
3 changes: 2 additions & 1 deletion packages/@vue/eslint-config-standard/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/eslint-config-standard"
},
"keywords": [
"vue",
3 changes: 2 additions & 1 deletion packages/@vue/eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/vue-cli.git"
"url": "git+https://github.com/vuejs/vue-cli.git",
"directory": "packages/@vue/eslint-config-typescript"
},
"keywords": [
"vue",
42 changes: 21 additions & 21 deletions packages/vue-cli-version-marker/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"name": "vue-cli-version-marker",
"version": "3.3.0",
"version": "3.4.0",
"description": "version marker for @vue/cli",
"author": "Evan You",
"license": "MIT",
"main": "package.json",
"devDependencies": {
"@vue/babel-preset-app": "3.3.0",
"@vue/cli-init": "3.3.0",
"@vue/cli-overlay": "3.3.0",
"@vue/cli-plugin-babel": "3.3.0",
"@vue/cli-plugin-e2e-cypress": "3.3.0",
"@vue/cli-plugin-e2e-nightwatch": "3.3.0",
"@vue/cli-plugin-eslint": "3.3.0",
"@vue/cli-plugin-pwa": "3.3.0",
"@vue/cli-plugin-typescript": "3.3.0",
"@vue/cli-plugin-unit-jest": "3.3.0",
"@vue/cli-plugin-unit-mocha": "3.3.0",
"@vue/cli-service-global": "3.3.0",
"@vue/cli-service": "3.3.0",
"@vue/cli-shared-utils": "3.3.0",
"@vue/cli-test-utils": "3.3.0",
"@vue/cli-ui-addon-webpack": "3.3.0",
"@vue/cli-ui-addon-widgets": "3.3.0",
"@vue/cli-ui": "3.3.0",
"@vue/cli-upgrade": "3.3.0",
"@vue/cli": "3.3.0"
"@vue/babel-preset-app": "3.4.0",
"@vue/cli-init": "3.4.0",
"@vue/cli-overlay": "3.4.0",
"@vue/cli-plugin-babel": "3.4.0",
"@vue/cli-plugin-e2e-cypress": "3.4.0",
"@vue/cli-plugin-e2e-nightwatch": "3.4.0",
"@vue/cli-plugin-eslint": "3.4.0",
"@vue/cli-plugin-pwa": "3.4.0",
"@vue/cli-plugin-typescript": "3.4.0",
"@vue/cli-plugin-unit-jest": "3.4.0",
"@vue/cli-plugin-unit-mocha": "3.4.0",
"@vue/cli-service-global": "3.4.0",
"@vue/cli-service": "3.4.0",
"@vue/cli-shared-utils": "3.4.0",
"@vue/cli-test-utils": "3.4.0",
"@vue/cli-ui-addon-webpack": "3.4.0",
"@vue/cli-ui-addon-widgets": "3.4.0",
"@vue/cli-ui": "3.4.0",
"@vue/cli-upgrade": "3.4.0",
"@vue/cli": "3.4.0"
}
}
2 changes: 1 addition & 1 deletion scripts/release.js
Original file line number Diff line number Diff line change
@@ -134,7 +134,7 @@ const release = async () => {
)

await execa('git', ['tag', tagName], { stdio: 'inherit' })
await execa('git', ['push', '--tags'], { stdio: 'inherit' })
await execa('git', ['push', '--follow-tags'], { stdio: 'inherit' })
}

release().catch(err => {
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -6059,6 +6059,11 @@ dot-prop@^4.1.0, dot-prop@^4.1.1, dot-prop@^4.2.0:
dependencies:
is-obj "^1.0.0"

dotenv@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==

download-git-repo@^1.0.1, download-git-repo@^1.0.2:
version "1.1.0"
resolved "https://registry.yarnpkg.com/download-git-repo/-/download-git-repo-1.1.0.tgz#7dc88a82ced064b1372a0002f8a3aebf10eb1d3c"