diff --git a/CHANGELOG.md b/CHANGELOG.md
index 60a7075d54..762114001c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,49 @@
+# [3.0.0-rc.12](https://github.com/vuejs/vue-cli/compare/v3.0.0-rc.11...v3.0.0-rc.12) (2018-08-09)
+
+## cli
+
+#### Features
+
+* support generator.js and prompts.js in preset ([3b21fad](https://github.com/vuejs/vue-cli/commit/3b21fad))
+
+## cli-service
+
+#### Bug Fixes
+
+* avoid os.cpus() error in certain envs ([327d041](https://github.com/vuejs/vue-cli/commit/327d041)), closes [#2110](https://github.com/vuejs/vue-cli/issues/2110)
+#### Code Refactoring
+
+* use better modern mode and cors implementation ([7b39bed](https://github.com/vuejs/vue-cli/commit/7b39bed))
+#### Features
+
+* support Subresource Integrity via `integrity` option ([55043d3](https://github.com/vuejs/vue-cli/commit/55043d3))
+
+## cli-service-global
+
+#### Bug Fixes
+
+* install vue-template-compiler for global service ([c42cb94](https://github.com/vuejs/vue-cli/commit/c42cb94))
+
+## cli-ui
+
+#### Bug Fixes
+
+* **build:** wrong arg name, closes [#2067](https://github.com/vuejs/vue-cli/issues/2067) ([fe66a44](https://github.com/vuejs/vue-cli/commit/fe66a44))
+
+## other
+
+#### Bug Fixes
+
+* ensure consistent build hash with different project locations ([9e4d62c](https://github.com/vuejs/vue-cli/commit/9e4d62c))
+
+
+### BREAKING CHANGES
+
+* The `corsUseCredentials` option has been replaced by the new
+`crossorigin` option.
+
+
+
# [3.0.0-rc.11](https://github.com/vuejs/vue-cli/compare/v3.0.0-rc.10...v3.0.0-rc.11) (2018-08-07)
## babel-preset-app
diff --git a/docs/.vuepress/style.styl b/docs/.vuepress/style.styl
index c3e09517e7..f272762b9c 100644
--- a/docs/.vuepress/style.styl
+++ b/docs/.vuepress/style.styl
@@ -3,3 +3,6 @@
.search-box .suggestion a
white-space normal
+
+#carbonads a
+ display inline !important
diff --git a/docs/config/README.md b/docs/config/README.md
index 2e768c9973..79e25f5f62 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -135,9 +135,13 @@ module.exports = {
- Type: `boolean | 'error'`
- Default: `true`
+ ::: tip
+ If you want lint errors to show up in the browser overlay, set this to `'error'`.
+ :::
+
Whether to perform lint-on-save during development using [eslint-loader](https://github.com/webpack-contrib/eslint-loader). This value is respected only when [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint) is installed.
- When set to `true`, eslint-loader will only emit warnings during webpack's compilation process in order not to break the flow during development. If you want it to emit errors instead (i.e. when building for production), set it like this: `lintOnSave: 'error'`.
+ When set to `true`, eslint-loader will emit warnings (which only get logged to the terminal to avoid interrupting development). If you want it to emit errors instead, set it to `'error'`. This will make lint errors show up in the in-browser dev overlay and will make your build fail on lint errors.
### runtimeCompiler
@@ -171,7 +175,7 @@ module.exports = {
Note that this only affects tags injected by `html-webpack-plugin` - tags directly added in the source template (`public/index.html`) are not affected.
- See also: [CROS setting attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes)
+ See also: [CORS setting attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes)
### integrity
diff --git a/docs/guide/css.md b/docs/guide/css.md
index 1929912adf..50eead9e57 100644
--- a/docs/guide/css.md
+++ b/docs/guide/css.md
@@ -2,6 +2,10 @@
Vue CLI projects comes with support for [PostCSS](http://postcss.org/), [CSS Modules](https://github.com/css-modules/css-modules) and pre-processors including [Sass](https://sass-lang.com/), [Less](http://lesscss.org/) and [Stylus](http://stylus-lang.com/).
+## Referencing Assets
+
+All compiled CSS are processed by [css-loader](https://github.com/webpack-contrib/css-loader), which parses `url()` and resolves them as module requests. This means you can refer to assets using relative paths based on the local file structure. Note if you want to reference a file inside an npm dependency or via webpack alias, the path must be prefixed with `~` to avoid ambiguity. See [Static Asset Handling](./html-and-static-assets.md#static-assets-handling) for more details.
+
## Pre-Processors
You can select pre-processors (Sass/Less/Stylus) when creating the project. If you did not do so, the internal webpack config is still pre-configured to handle all of them. You just need to manually install the corresponding webpack loaders:
diff --git a/docs/guide/html-and-static-assets.md b/docs/guide/html-and-static-assets.md
index 1e070055a1..5fd982feb7 100644
--- a/docs/guide/html-and-static-assets.md
+++ b/docs/guide/html-and-static-assets.md
@@ -151,10 +151,10 @@ module.exports = {
- If the URL starts with `~`, anything after it is interpreted as a module request. This means you can even reference assets inside node modules:
``` html
-
+
```
-- If the URL starts with `@`, it's also interpreted as a module request. This is useful because Vue CLI by default aliases `@` to `/src`.
+- If the URL starts with `@`, it's also interpreted as a module request. This is useful because Vue CLI by default aliases `@` to `/src`. **(templates only)**
### The `public` Folder
diff --git a/docs/guide/installation.md b/docs/guide/installation.md
index e837abb412..fb160be2f0 100644
--- a/docs/guide/installation.md
+++ b/docs/guide/installation.md
@@ -1,6 +1,6 @@
# Installation
-::: danger
+::: warning Warning regarding Previous Versions
The package name changed from `vue-cli` to `@vue/cli`.
If you have the previous `vue-cli` (1.x or 2.x) package installed globally, you need to uninstall it first with `npm uninstall vue-cli -g` or `yarn global remove vue-cli`.
:::
diff --git a/docs/zh/config/README.md b/docs/zh/config/README.md
index c47bc81103..87f2979344 100644
--- a/docs/zh/config/README.md
+++ b/docs/zh/config/README.md
@@ -133,9 +133,13 @@ module.exports = {
- Type: `boolean` | `'error'`
- Default: `true`
+ ::: tip
+ 如果你想要让 lint 错误在开发时直接显示在浏览器中,将这个选项设置为 `'error'`。
+ :::
+
是否在开发环境下通过 [eslint-loader](https://github.com/webpack-contrib/eslint-loader) 在每次保存时 lint 代码。这个值会在 [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint) 被安装之后生效。
- 设置为 `true` 时,eslint-loader 在 webpack 的编译过程中只会触发警告,以避免中断开发流程。如果你希望换做触发错误 (例如在为生成环境构建时),可以这样设置:`lintOnSave: 'error'`。
+ 设置为 `true` 时,eslint-loader 在 webpack 的编译过程中会触发输出到控制台的警告,以避免中断开发流程。如果设置为 `'error'`,则 lint 错误会在开发时直接显示在浏览器中。另外构建时如果存在 lint 错误会导致构建失败。
### runtimeCompiler
diff --git a/docs/zh/guide/css.md b/docs/zh/guide/css.md
index 2404e1109b..c4c30f119e 100644
--- a/docs/zh/guide/css.md
+++ b/docs/zh/guide/css.md
@@ -1,7 +1,11 @@
-# 配合 CSS
+# CSS 相关
Vue CLI 项目天生支持 [PostCSS](http://postcss.org/)、[CSS Modules](https://github.com/css-modules/css-modules) 和包含 [Sass](https://sass-lang.com/)、[Less](http://lesscss.org/)、[Stylus](http://stylus-lang.com/) 在内的预处理器。
+## 引用静态资源
+
+所有编译后的 CSS 都会通过 [css-loader](https://github.com/webpack-contrib/css-loader) 来解析其中的 `url()` 引用,并将这些引用作为模块请求来处理。这意味着你可以根据本地的文件结构用相对路径来引用静态资源。另外要注意的是如果你想要引用一个 npm 依赖中的文件,或是想要用 webpack alias,则需要在路径前加上 `~` 的前缀来避免歧义。更多细节请参考[处理静态资源](./html-and-static-assets.md#处理静态资源)。
+
## 预处理器
你可以在创建项目的时候选择预处理器 (Sass/Less/Stylus)。如果当时没有选好,内置的 webpack 仍然会被预配置为可以完成所有的处理。你也可以手动安装相应的 webpack loader:
diff --git a/docs/zh/guide/html-and-static-assets.md b/docs/zh/guide/html-and-static-assets.md
index 7d8a60ec2f..d818f1f043 100644
--- a/docs/zh/guide/html-and-static-assets.md
+++ b/docs/zh/guide/html-and-static-assets.md
@@ -139,7 +139,7 @@ h('img', { attrs: { src: require('./image.png') }})
```
-- 如果 URL 以 `@` 开头,它也会作为一个模块请求被解析。它的用处在于 Vue CLI 默认会设置一个指向 `/src` 的别名 `@`。
+- 如果 URL 以 `@` 开头,它也会作为一个模块请求被解析。它的用处在于 Vue CLI 默认会设置一个指向 `/src` 的别名 `@`。**(仅作用于模版中)**
### `public` 文件夹
diff --git a/docs/zh/guide/installation.md b/docs/zh/guide/installation.md
index 21eb508770..bad1320cda 100644
--- a/docs/zh/guide/installation.md
+++ b/docs/zh/guide/installation.md
@@ -1,7 +1,7 @@
# 安装
-::: danger 危险
-我们的包名由 `vue-cli` 改成了 `@vue/cli`。
+::: warning 关于旧版本
+VUe CLI 的包名称由 `vue-cli` 改成了 `@vue/cli`。
如果你已经全局安装了旧版本的 `vue-cli` (1.x 或 2.x),你需要先通过 `npm uninstall vue-cli -g` 或 `yarn global remove vue-cli` 卸载它。
:::
diff --git a/docs/zh/guide/webpack.md b/docs/zh/guide/webpack.md
index e19c3e3f77..f31fc21acb 100644
--- a/docs/zh/guide/webpack.md
+++ b/docs/zh/guide/webpack.md
@@ -1,4 +1,4 @@
-# 配合 webpack
+# webpack 相关
## 简单的配置方式
diff --git a/lerna.json b/lerna.json
index 269e2536ee..d492939e2d 100644
--- a/lerna.json
+++ b/lerna.json
@@ -2,5 +2,5 @@
"lerna": "2.5.1",
"npmClient": "yarn",
"useWorkspaces": true,
- "version": "3.0.0-rc.12"
+ "version": "3.0.0"
}
diff --git a/package.json b/package.json
index 24222cc83f..680cc37426 100644
--- a/package.json
+++ b/package.json
@@ -67,9 +67,9 @@
"request-promise-native": "^1.0.5",
"rimraf": "^2.6.2",
"semver": "^5.5.0",
- "vuepress": "^0.14.0",
+ "vuepress": "^0.14.1",
"vuepress-theme-vue": "^1.1.0",
- "yorkie": "^1.0.2"
+ "yorkie": "^2.0.0"
},
"resolutions": {
"fs-monkey": "0.3.1",
diff --git a/packages/@vue/babel-preset-app/package.json b/packages/@vue/babel-preset-app/package.json
index 8af63223a9..d2462275b4 100644
--- a/packages/@vue/babel-preset-app/package.json
+++ b/packages/@vue/babel-preset-app/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/babel-preset-app",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "babel-preset-app for vue-cli",
"main": "index.js",
"publishConfig": {
diff --git a/packages/@vue/cli-init/package.json b/packages/@vue/cli-init/package.json
index 9d6fa10caf..bb13222aa6 100644
--- a/packages/@vue/cli-init/package.json
+++ b/packages/@vue/cli-init/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-init",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "init addon for vue-cli",
"main": "index.js",
"publishConfig": {
diff --git a/packages/@vue/cli-overlay/package.json b/packages/@vue/cli-overlay/package.json
index 840c88cc26..01a4bb47cc 100644
--- a/packages/@vue/cli-overlay/package.json
+++ b/packages/@vue/cli-overlay/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-overlay",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "error overlay & dev server middleware for vue-cli",
"main": "dist/client.js",
"files": [
diff --git a/packages/@vue/cli-plugin-babel/package.json b/packages/@vue/cli-plugin-babel/package.json
index e3da26aa1c..c79c7e7ffc 100644
--- a/packages/@vue/cli-plugin-babel/package.json
+++ b/packages/@vue/cli-plugin-babel/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-babel",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "babel plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -20,7 +20,7 @@
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-babel#readme",
"dependencies": {
"@babel/core": "7.0.0-beta.47",
- "@vue/babel-preset-app": "^3.0.0-rc.12",
+ "@vue/babel-preset-app": "^3.0.0",
"babel-loader": "^8.0.0-0"
},
"publishConfig": {
diff --git a/packages/@vue/cli-plugin-e2e-cypress/package.json b/packages/@vue/cli-plugin-e2e-cypress/package.json
index 2cab564cd3..55de68024a 100644
--- a/packages/@vue/cli-plugin-e2e-cypress/package.json
+++ b/packages/@vue/cli-plugin-e2e-cypress/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-e2e-cypress",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "e2e-cypress plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -22,7 +22,7 @@
"access": "public"
},
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"cypress": "^3.0.2",
"eslint-plugin-cypress": "^2.0.1"
}
diff --git a/packages/@vue/cli-plugin-e2e-nightwatch/package.json b/packages/@vue/cli-plugin-e2e-nightwatch/package.json
index 28cfc54d37..7dea7fab4a 100644
--- a/packages/@vue/cli-plugin-e2e-nightwatch/package.json
+++ b/packages/@vue/cli-plugin-e2e-nightwatch/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-e2e-nightwatch",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "e2e-nightwatch plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -22,7 +22,7 @@
"access": "public"
},
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"chromedriver": "^2.40.0",
"deepmerge": "^2.1.1",
"execa": "^0.10.0",
diff --git a/packages/@vue/cli-plugin-eslint/generator.js b/packages/@vue/cli-plugin-eslint/generator.js
index eac20fac08..cf4456a71d 100644
--- a/packages/@vue/cli-plugin-eslint/generator.js
+++ b/packages/@vue/cli-plugin-eslint/generator.js
@@ -16,17 +16,17 @@ module.exports = (api, { config, lintOn = [] }, _, invoking) => {
if (config === 'airbnb') {
eslintConfig.extends.push('@vue/airbnb')
Object.assign(pkg.devDependencies, {
- '@vue/eslint-config-airbnb': '^3.0.0-rc.12'
+ '@vue/eslint-config-airbnb': '^3.0.0'
})
} else if (config === 'standard') {
eslintConfig.extends.push('@vue/standard')
Object.assign(pkg.devDependencies, {
- '@vue/eslint-config-standard': '^3.0.0-rc.12'
+ '@vue/eslint-config-standard': '^3.0.0'
})
} else if (config === 'prettier') {
eslintConfig.extends.push('@vue/prettier')
Object.assign(pkg.devDependencies, {
- '@vue/eslint-config-prettier': '^3.0.0-rc.12'
+ '@vue/eslint-config-prettier': '^3.0.0'
})
} else {
// default
@@ -87,7 +87,7 @@ const applyTS = module.exports.applyTS = api => {
}
},
devDependencies: {
- '@vue/eslint-config-typescript': '^3.0.0-rc.12'
+ '@vue/eslint-config-typescript': '^3.0.0'
}
})
}
diff --git a/packages/@vue/cli-plugin-eslint/package.json b/packages/@vue/cli-plugin-eslint/package.json
index cf1c298124..815543d29f 100644
--- a/packages/@vue/cli-plugin-eslint/package.json
+++ b/packages/@vue/cli-plugin-eslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-eslint",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "eslint plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -22,7 +22,7 @@
"access": "public"
},
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"babel-eslint": "^8.2.5",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
diff --git a/packages/@vue/cli-plugin-pwa/package.json b/packages/@vue/cli-plugin-pwa/package.json
index 2e5f7448b2..c304fa6b58 100644
--- a/packages/@vue/cli-plugin-pwa/package.json
+++ b/packages/@vue/cli-plugin-pwa/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-pwa",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "pwa plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -22,7 +22,7 @@
"access": "public"
},
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"workbox-webpack-plugin": "^3.3.1"
},
"devDependencies": {
diff --git a/packages/@vue/cli-plugin-typescript/package.json b/packages/@vue/cli-plugin-typescript/package.json
index 01d33124e0..c6cd9681f2 100644
--- a/packages/@vue/cli-plugin-typescript/package.json
+++ b/packages/@vue/cli-plugin-typescript/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-typescript",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "typescript plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -23,7 +23,7 @@
},
"dependencies": {
"@types/node": "^10.5.2",
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"fork-ts-checker-webpack-plugin": "^0.4.4",
"globby": "^8.0.1",
"ts-loader": "^4.4.2",
diff --git a/packages/@vue/cli-plugin-unit-jest/package.json b/packages/@vue/cli-plugin-unit-jest/package.json
index bc0082b262..1c4c34b29f 100644
--- a/packages/@vue/cli-plugin-unit-jest/package.json
+++ b/packages/@vue/cli-plugin-unit-jest/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-unit-jest",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "unit-jest plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -22,7 +22,7 @@
"access": "public"
},
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"babel-jest": "^23.4.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"jest": "^23.4.0",
diff --git a/packages/@vue/cli-plugin-unit-mocha/package.json b/packages/@vue/cli-plugin-unit-mocha/package.json
index af2c621369..de908c84d9 100644
--- a/packages/@vue/cli-plugin-unit-mocha/package.json
+++ b/packages/@vue/cli-plugin-unit-mocha/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-plugin-unit-mocha",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "mocha unit testing plugin for vue-cli",
"main": "index.js",
"repository": {
@@ -21,7 +21,7 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"jsdom": "^11.11.0",
"jsdom-global": "^3.0.2",
"mocha": "^5.2.0",
diff --git a/packages/@vue/cli-service-global/package.json b/packages/@vue/cli-service-global/package.json
index 53c5fe9253..9588b507bc 100644
--- a/packages/@vue/cli-service-global/package.json
+++ b/packages/@vue/cli-service-global/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-service-global",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "vue-cli-service global addon for vue-cli",
"main": "index.js",
"publishConfig": {
@@ -21,10 +21,10 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-build#readme",
"dependencies": {
- "@vue/babel-preset-app": "^3.0.0-rc.12",
- "@vue/cli-plugin-babel": "^3.0.0-rc.12",
- "@vue/cli-plugin-eslint": "^3.0.0-rc.12",
- "@vue/cli-service": "^3.0.0-rc.12",
+ "@vue/babel-preset-app": "^3.0.0",
+ "@vue/cli-plugin-babel": "^3.0.0",
+ "@vue/cli-plugin-eslint": "^3.0.0",
+ "@vue/cli-service": "^3.0.0",
"chalk": "^2.4.1",
"eslint-plugin-vue": "^4.5.0",
"resolve": "^1.8.1",
diff --git a/packages/@vue/cli-service/__tests__/Service.spec.js b/packages/@vue/cli-service/__tests__/Service.spec.js
index 5dab39c795..a71c8d4e9c 100644
--- a/packages/@vue/cli-service/__tests__/Service.spec.js
+++ b/packages/@vue/cli-service/__tests__/Service.spec.js
@@ -62,7 +62,7 @@ test('loading plugins from package.json', () => {
mockPkg({
devDependencies: {
'bar': '^1.0.0',
- '@vue/cli-plugin-babel': '^3.0.0-rc.12',
+ '@vue/cli-plugin-babel': '^3.0.0',
'vue-cli-plugin-foo': '^1.0.0'
}
})
diff --git a/packages/@vue/cli-service/lib/commands/build/index.js b/packages/@vue/cli-service/lib/commands/build/index.js
index 1df2f34461..227a83f546 100644
--- a/packages/@vue/cli-service/lib/commands/build/index.js
+++ b/packages/@vue/cli-service/lib/commands/build/index.js
@@ -81,6 +81,7 @@ async function build (args, api, options) {
const chalk = require('chalk')
const webpack = require('webpack')
const formatStats = require('./formatStats')
+ const validateWebpackConfig = require('../../util/validateWebpackConfig')
const {
log,
done,
@@ -123,6 +124,9 @@ async function build (args, api, options) {
webpackConfig = require('./resolveAppConfig')(api, args, options)
}
+ // check for common config errors
+ validateWebpackConfig(webpackConfig, api, options, args.target)
+
// apply inline dest path after user configureWebpack hooks
// so it takes higher priority
if (args.dest) {
@@ -131,31 +135,6 @@ async function build (args, api, options) {
})
}
- // grab the actual output path and check for common mis-configuration
- const actualTargetDir = (
- Array.isArray(webpackConfig)
- ? webpackConfig[0]
- : webpackConfig
- ).output.path
-
- if (!args.dest && actualTargetDir !== api.resolve(options.outputDir)) {
- // user directly modifies output.path in configureWebpack or chainWebpack.
- // this is not supported because there's no way for us to give copy
- // plugin the correct value this way.
- throw new Error(
- `\n\nConfiguration Error: ` +
- `Avoid modifying webpack output.path directly. ` +
- `Use the "outputDir" option instead.\n`
- )
- }
-
- if (actualTargetDir === api.service.context) {
- throw new Error(
- `\n\nConfiguration Error: ` +
- `Do not set output directory to project root.\n`
- )
- }
-
if (args.watch) {
modifyConfig(webpackConfig, config => {
config.watch = true
diff --git a/packages/@vue/cli-service/lib/commands/serve.js b/packages/@vue/cli-service/lib/commands/serve.js
index 18ae20178a..9a867b8fb4 100644
--- a/packages/@vue/cli-service/lib/commands/serve.js
+++ b/packages/@vue/cli-service/lib/commands/serve.js
@@ -41,10 +41,14 @@ module.exports = (api, options) => {
const prepareURLs = require('../util/prepareURLs')
const prepareProxy = require('../util/prepareProxy')
const launchEditorMiddleware = require('launch-editor-middleware')
+ const validateWebpackConfig = require('../util/validateWebpackConfig')
// resolve webpack config
const webpackConfig = api.resolveWebpackConfig()
+ // check for common config errors
+ validateWebpackConfig(webpackConfig, api, options)
+
// load user devServer options with higher priority than devServer
// in webpck config
const projectDevServerOptions = Object.assign(
diff --git a/packages/@vue/cli-service/lib/options.js b/packages/@vue/cli-service/lib/options.js
index a542dad2b2..c46d4b0492 100644
--- a/packages/@vue/cli-service/lib/options.js
+++ b/packages/@vue/cli-service/lib/options.js
@@ -96,7 +96,7 @@ exports.defaults = () => ({
crossorigin: undefined,
// subresource integrity
- integreity: false,
+ integrity: false,
css: {
// extract: true,
diff --git a/packages/@vue/cli-service/lib/util/validateWebpackConfig.js b/packages/@vue/cli-service/lib/util/validateWebpackConfig.js
new file mode 100644
index 0000000000..83bf23fa92
--- /dev/null
+++ b/packages/@vue/cli-service/lib/util/validateWebpackConfig.js
@@ -0,0 +1,38 @@
+module.exports = function validateWebpackConfig (
+ webpackConfig,
+ api,
+ options,
+ target = 'app'
+) {
+ const singleConfig = Array.isArray(webpackConfig)
+ ? webpackConfig[0]
+ : webpackConfig
+
+ const actualTargetDir = singleConfig.output.path
+
+ if (actualTargetDir !== api.resolve(options.outputDir)) {
+ // user directly modifies output.path in configureWebpack or chainWebpack.
+ // this is not supported because there's no way for us to give copy
+ // plugin the correct value this way.
+ throw new Error(
+ `\n\nConfiguration Error: ` +
+ `Avoid modifying webpack output.path directly. ` +
+ `Use the "outputDir" option instead.\n`
+ )
+ }
+
+ if (actualTargetDir === api.service.context) {
+ throw new Error(
+ `\n\nConfiguration Error: ` +
+ `Do not set output directory to project root.\n`
+ )
+ }
+
+ if (target === 'app' && singleConfig.output.publicPath !== options.baseUrl) {
+ throw new Error(
+ `\n\nConfiguration Error: ` +
+ `Avoid modifying webpack output.publicPath directly. ` +
+ `Use the "baseUrl" option instead.\n`
+ )
+ }
+}
diff --git a/packages/@vue/cli-service/package.json b/packages/@vue/cli-service/package.json
index ccaafa3ac0..0b75517ba5 100644
--- a/packages/@vue/cli-service/package.json
+++ b/packages/@vue/cli-service/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-service",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "local service for vue-cli projects",
"main": "lib/Service.js",
"bin": {
@@ -22,8 +22,8 @@
"homepage": "https://cli.vuejs.org/",
"dependencies": {
"@intervolga/optimize-cssnano-plugin": "^1.0.5",
- "@vue/cli-overlay": "^3.0.0-rc.12",
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-overlay": "^3.0.0",
+ "@vue/cli-shared-utils": "^3.0.0",
"@vue/preload-webpack-plugin": "^1.1.0",
"@vue/web-component-wrapper": "^1.2.0",
"acorn": "^5.7.1",
@@ -68,7 +68,7 @@
"webpack-chain": "^4.8.0",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.3",
- "yorkie": "^1.0.3"
+ "yorkie": "^2.0.0"
},
"peerDependencies": {
"vue-template-compiler": "^2.0.0"
diff --git a/packages/@vue/cli-shared-utils/package.json b/packages/@vue/cli-shared-utils/package.json
index 59b1fcbcd2..e98f291e0b 100644
--- a/packages/@vue/cli-shared-utils/package.json
+++ b/packages/@vue/cli-shared-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-shared-utils",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "shared utilities for vue-cli packages",
"main": "index.js",
"repository": {
diff --git a/packages/@vue/cli-test-utils/package.json b/packages/@vue/cli-test-utils/package.json
index c6f7a96b98..2ed5e11d6d 100644
--- a/packages/@vue/cli-test-utils/package.json
+++ b/packages/@vue/cli-test-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-test-utils",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "test utilities for vue-cli packages",
"repository": {
"type": "git",
diff --git a/packages/@vue/cli-ui-addon-webpack/package.json b/packages/@vue/cli-ui-addon-webpack/package.json
index 2c68e42586..3ef6e9ecc3 100644
--- a/packages/@vue/cli-ui-addon-webpack/package.json
+++ b/packages/@vue/cli-ui-addon-webpack/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-ui-addon-webpack",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"files": [
"dist",
"src"
@@ -12,10 +12,10 @@
"prepublishOnly": "yarn run lint --no-fix && yarn run build"
},
"devDependencies": {
- "@vue/cli-plugin-babel": "^3.0.0-rc.12",
- "@vue/cli-plugin-eslint": "^3.0.0-rc.12",
- "@vue/cli-service": "^3.0.0-rc.12",
- "@vue/eslint-config-standard": "^3.0.0-rc.12",
+ "@vue/cli-plugin-babel": "^3.0.0",
+ "@vue/cli-plugin-eslint": "^3.0.0",
+ "@vue/cli-service": "^3.0.0",
+ "@vue/eslint-config-standard": "^3.0.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue-progress-path": "^0.0.2",
diff --git a/packages/@vue/cli-ui/package.json b/packages/@vue/cli-ui/package.json
index c1b8751364..75d40f0b51 100644
--- a/packages/@vue/cli-ui/package.json
+++ b/packages/@vue/cli-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli-ui",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"scripts": {
"serve": "cross-env VUE_APP_CLI_UI_URL=ws://localhost:4000/graphql vue-cli-service serve",
"build": "vue-cli-service build",
@@ -28,7 +28,7 @@
],
"dependencies": {
"@akryum/winattr": "^3.0.0",
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
"chalk": "^2.4.1",
"clone": "^2.1.1",
"deepmerge": "^2.1.1",
@@ -56,11 +56,11 @@
"watch": "^1.0.2"
},
"devDependencies": {
- "@vue/cli-plugin-babel": "^3.0.0-rc.12",
- "@vue/cli-plugin-e2e-cypress": "^3.0.0-rc.12",
- "@vue/cli-plugin-eslint": "^3.0.0-rc.12",
- "@vue/cli-service": "^3.0.0-rc.12",
- "@vue/eslint-config-standard": "^3.0.0-rc.12",
+ "@vue/cli-plugin-babel": "^3.0.0",
+ "@vue/cli-plugin-e2e-cypress": "^3.0.0",
+ "@vue/cli-plugin-eslint": "^3.0.0",
+ "@vue/cli-service": "^3.0.0",
+ "@vue/eslint-config-standard": "^3.0.0",
"@vue/ui": "^0.4.6",
"ansi_up": "^3.0.0",
"cross-env": "^5.1.5",
diff --git a/packages/@vue/cli/lib/Generator.js b/packages/@vue/cli/lib/Generator.js
index 21b9280d9f..b855ce2b14 100644
--- a/packages/@vue/cli/lib/Generator.js
+++ b/packages/@vue/cli/lib/Generator.js
@@ -58,6 +58,13 @@ const reservedConfigTransforms = {
})
}
+const ensureEOL = str => {
+ if (str.charAt(str.length - 1) !== '\n') {
+ return str + '\n'
+ }
+ return str
+}
+
module.exports = class Generator {
constructor (context, {
pkg = {},
@@ -109,7 +116,7 @@ module.exports = class Generator {
await this.resolveFiles()
// set package.json
this.sortPkg()
- this.files['package.json'] = JSON.stringify(this.pkg, null, 2)
+ this.files['package.json'] = JSON.stringify(this.pkg, null, 2) + '\n'
// write/update file tree to disk
await writeFileTree(this.context, this.files, initialFiles)
}
@@ -136,7 +143,7 @@ module.exports = class Generator {
this.context
)
const { content, filename } = res
- this.files[filename] = content
+ this.files[filename] = ensureEOL(content)
delete this.pkg[key]
}
}
diff --git a/packages/@vue/cli/package.json b/packages/@vue/cli/package.json
index a239a06820..f7b107f21f 100644
--- a/packages/@vue/cli/package.json
+++ b/packages/@vue/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/cli",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "Command line interface for rapid Vue.js development",
"bin": {
"vue": "bin/vue.js"
@@ -23,9 +23,9 @@
"access": "public"
},
"dependencies": {
- "@vue/cli-shared-utils": "^3.0.0-rc.12",
- "@vue/cli-ui": "^3.0.0-rc.12",
- "@vue/cli-ui-addon-webpack": "^3.0.0-rc.12",
+ "@vue/cli-shared-utils": "^3.0.0",
+ "@vue/cli-ui": "^3.0.0",
+ "@vue/cli-ui-addon-webpack": "^3.0.0",
"chalk": "^2.4.1",
"cmd-shim": "^2.0.2",
"commander": "^2.16.0",
diff --git a/packages/@vue/eslint-config-airbnb/package.json b/packages/@vue/eslint-config-airbnb/package.json
index 8a5ed79c0c..f639fb172f 100644
--- a/packages/@vue/eslint-config-airbnb/package.json
+++ b/packages/@vue/eslint-config-airbnb/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/eslint-config-airbnb",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "eslint-config-airbnb for vue-cli",
"main": "index.js",
"publishConfig": {
diff --git a/packages/@vue/eslint-config-prettier/package.json b/packages/@vue/eslint-config-prettier/package.json
index abc9edbb1a..38f32731e3 100644
--- a/packages/@vue/eslint-config-prettier/package.json
+++ b/packages/@vue/eslint-config-prettier/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/eslint-config-prettier",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "eslint-config-prettier for vue-cli",
"main": "index.js",
"publishConfig": {
diff --git a/packages/@vue/eslint-config-standard/package.json b/packages/@vue/eslint-config-standard/package.json
index e5e2a8300c..82d9984401 100644
--- a/packages/@vue/eslint-config-standard/package.json
+++ b/packages/@vue/eslint-config-standard/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/eslint-config-standard",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "eslint-config-standard for vue-cli",
"main": "index.js",
"publishConfig": {
diff --git a/packages/@vue/eslint-config-typescript/package.json b/packages/@vue/eslint-config-typescript/package.json
index dbeac7be8f..5fe3ea94c2 100644
--- a/packages/@vue/eslint-config-typescript/package.json
+++ b/packages/@vue/eslint-config-typescript/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/eslint-config-typescript",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "eslint-config-typescript for vue-cli",
"main": "index.js",
"publishConfig": {
diff --git a/packages/vue-cli-version-marker/package.json b/packages/vue-cli-version-marker/package.json
index 333a804b29..c8fe895f10 100644
--- a/packages/vue-cli-version-marker/package.json
+++ b/packages/vue-cli-version-marker/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-cli-version-marker",
- "version": "3.0.0-rc.12",
+ "version": "3.0.0",
"description": "version marker for @vue/cli",
"author": "Evan You",
"license": "MIT"
diff --git a/yarn.lock b/yarn.lock
index 1aa9ed4db5..050a157f48 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -12581,9 +12581,9 @@ vuepress-theme-vue@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/vuepress-theme-vue/-/vuepress-theme-vue-1.1.0.tgz#8b109e3db8cad7b18459f4d77076808110c2bcaa"
-vuepress@^0.14.0:
- version "0.14.0"
- resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-0.14.0.tgz#4281d0576651de05ad07cb5e8982052f8db9d14d"
+vuepress@^0.14.1:
+ version "0.14.1"
+ resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-0.14.1.tgz#4b3fc46601ce2fd8ff2265a2e39098b9f9580c58"
dependencies:
"@babel/core" "7.0.0-beta.47"
"@vue/babel-preset-app" "3.0.0-beta.11"
@@ -13349,9 +13349,9 @@ ylru@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f"
-yorkie@^1.0.2, yorkie@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/yorkie/-/yorkie-1.0.3.tgz#5c05db48c012def99c29b79685b6ba2e40c8c671"
+yorkie@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/yorkie/-/yorkie-2.0.0.tgz#92411912d435214e12c51c2ae1093e54b6bb83d9"
dependencies:
execa "^0.8.0"
is-ci "^1.0.10"