From b84451b506aad94567dd20b8ab569f0a4c4736c8 Mon Sep 17 00:00:00 2001 From: Johnathan Kent Date: Thu, 6 Apr 2017 16:59:00 -0600 Subject: [PATCH 1/5] clarifying and updating a few paths in code examples (#594) --- docs/backend.md | 1 + docs/linter.md | 1 + docs/static.md | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/backend.md b/docs/backend.md index 7a836dc0b7..d03eebc9d7 100644 --- a/docs/backend.md +++ b/docs/backend.md @@ -5,6 +5,7 @@ If you are building a purely-static app (one that is deployed separately from th Let's take a look at the default `config/index.js`: ``` js +// config/index.js var path = require('path') module.exports = { diff --git a/docs/linter.md b/docs/linter.md index 0bc3be10f5..f5ad42f662 100644 --- a/docs/linter.md +++ b/docs/linter.md @@ -7,6 +7,7 @@ If you are not happy with the default linting rules, you have several options: 1. Overwrite individual rules in `.eslintrc.js`. For example, you can add the following rule to enforce semicolons instead of omitting them: ``` js + // .eslintrc.js "semi": [2, "always"] ``` diff --git a/docs/static.md b/docs/static.md index f9f9a3ce71..ab2fb02a97 100644 --- a/docs/static.md +++ b/docs/static.md @@ -41,7 +41,7 @@ In comparison, files in `static/` are not processed by Webpack at all: they are As an example, with the following default values: ``` js -// config.js +// config/index.js module.exports = { // ... build: { From 28adbe5f9aa01257b9a852cd70c2328f37859c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=9A=E8=B0=94=E7=9A=84=E7=8C=AB?= Date: Fri, 7 Apr 2017 20:27:20 +0800 Subject: [PATCH 2/5] update: check-version (fix#656) --- template/build/check-versions.js | 11 +++++++---- template/package.json | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/template/build/check-versions.js b/template/build/check-versions.js index 6548ba18e1..100f3a0fe3 100644 --- a/template/build/check-versions.js +++ b/template/build/check-versions.js @@ -1,7 +1,7 @@ var chalk = require('chalk') var semver = require('semver') var packageConfig = require('../package.json') - +var shell = require('shelljs') function exec (cmd) { return require('child_process').execSync(cmd).toString().trim() } @@ -12,12 +12,15 @@ var versionRequirements = [ currentVersion: semver.clean(process.version), versionRequirement: packageConfig.engines.node }, - { +] + +if (shell.which('npm')) { + versionRequirements.push({ name: 'npm', currentVersion: exec('npm --version'), versionRequirement: packageConfig.engines.npm - } -] + }) +} module.exports = function () { var warnings = [] diff --git a/template/package.json b/template/package.json index 5c420a2a93..fce39a7819 100644 --- a/template/package.json +++ b/template/package.json @@ -82,6 +82,7 @@ "selenium-server": "^3.0.1", {{/e2e}} "semver": "^5.3.0", + "shelljs": "^0.7.6", "opn": "^4.0.2", "optimize-css-assets-webpack-plugin": "^1.3.0", "ora": "^1.1.0", From 2c338748de6b329e1c3409a8ca3a224345494be9 Mon Sep 17 00:00:00 2001 From: Aaron Cunningham Date: Sat, 8 Apr 2017 12:41:05 -0700 Subject: [PATCH 3/5] Fix typo, "Handing" to "Handling" --- docs/static.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/static.md b/docs/static.md index f9f9a3ce71..3407dfa988 100644 --- a/docs/static.md +++ b/docs/static.md @@ -1,4 +1,4 @@ -# Handing Static Assets +# Handling Static Assets You will notice in the project structure we have two directories for static assets: `src/assets` and `static/`. What is the difference between them? From 6f7c03d85021c426aaa7465406a43bcf503a13d9 Mon Sep 17 00:00:00 2001 From: Andrei Kashcha Date: Sat, 8 Apr 2017 16:00:52 -0700 Subject: [PATCH 4/5] `npm start` to start the dev server Just a small alias to make launching the service more convenient. --- template/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/template/package.json b/template/package.json index 99e706d6c5..ca6a4960e3 100644 --- a/template/package.json +++ b/template/package.json @@ -6,6 +6,7 @@ "private": true, "scripts": { "dev": "node build/dev-server.js", + "start": "node build/dev-server.js", "build": "node build/build.js"{{#unit}}, "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run"{{/unit}}{{#e2e}}, "e2e": "node test/e2e/runner.js"{{/e2e}}{{#if_or unit e2e}}, From 75dacdfbc20f8346f97b120fdcda0c5f4e925056 Mon Sep 17 00:00:00 2001 From: BelinChung Date: Mon, 10 Apr 2017 13:48:31 +0800 Subject: [PATCH 5/5] Upgrade url-loader to ^0.5.8 When you require a module which handle by url-loader (example: main.js ===> require('assets/img/logo.png')) An error may be reported ``` Module build failed: Error: parseQuery should get a string as first argument ``` `loader-utils@0.2.16` was fixed this issue and `url-loader@0.5.8` upgraded `loader-utils` to `v1.1.0` --- template/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/package.json b/template/package.json index 7c3519d6aa..9b20d6b6ff 100644 --- a/template/package.json +++ b/template/package.json @@ -88,7 +88,7 @@ "optimize-css-assets-webpack-plugin": "^1.3.0", "ora": "^1.1.0", "rimraf": "^2.6.0", - "url-loader": "^0.5.7", + "url-loader": "^0.5.8", "vue-loader": "^11.1.4", "vue-style-loader": "^2.0.0", "vue-template-compiler": "^2.2.4",