Skip to content

Commit f93e45b

Browse files
committed
Merge branch 'develop'
* develop: correct wording for #1155 bump version to 1.2.7 remove eventsource-polyfill (#1169) Remove useless code when lint is not chosen (#1165) Set spawn opt shell as true to avoid ENOENT (#1170) restore gitignore [WIP] Accurate CompleteMsg when not using autoInstall (fix #1157) (#1158) close #1155
2 parents b2fd0de + 2d99f8c commit f93e45b

File tree

8 files changed

+127
-83
lines changed

8 files changed

+127
-83
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ node_modules
22
.DS_Store
33
docs/_book
44
test/
5+
node_modules
6+
.DS_Store
7+
docs/_book
8+
test/

meta.js

+52-49
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
const path = require('path');
2-
const fs = require('fs');
1+
const path = require('path')
2+
const fs = require('fs')
33
const {
44
sortDependencies,
55
installDependencies,
66
runLintFix,
7-
printMessage
7+
printMessage,
88
} = require('./utils')
99

1010
module.exports = {
1111
helpers: {
12-
if_or: function (v1, v2, options) {
12+
if_or: function(v1, v2, options) {
1313
if (v1 || v2) {
14-
return options.fn(this);
14+
return options.fn(this)
1515
}
1616

17-
return options.inverse(this);
18-
}
17+
return options.inverse(this)
18+
},
1919
},
2020
prompts: {
2121
name: {
2222
type: 'string',
2323
required: true,
24-
message: 'Project name'
24+
message: 'Project name',
2525
},
2626
description: {
2727
type: 'string',
2828
required: false,
2929
message: 'Project description',
30-
default: 'A Vue.js project'
30+
default: 'A Vue.js project',
3131
},
3232
author: {
3333
type: 'string',
34-
message: 'Author'
34+
message: 'Author',
3535
},
3636
build: {
3737
type: 'list',
@@ -40,22 +40,23 @@ module.exports = {
4040
{
4141
name: 'Runtime + Compiler: recommended for most users',
4242
value: 'standalone',
43-
short: 'standalone'
43+
short: 'standalone',
4444
},
4545
{
46-
name: 'Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files - render functions are required elsewhere',
46+
name:
47+
'Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files - render functions are required elsewhere',
4748
value: 'runtime',
48-
short: 'runtime'
49-
}
50-
]
49+
short: 'runtime',
50+
},
51+
],
5152
},
5253
router: {
5354
type: 'confirm',
54-
message: 'Install vue-router?'
55+
message: 'Install vue-router?',
5556
},
5657
lint: {
5758
type: 'confirm',
58-
message: 'Use ESLint to lint your code?'
59+
message: 'Use ESLint to lint your code?',
5960
},
6061
lintConfig: {
6162
when: 'lint',
@@ -65,23 +66,23 @@ module.exports = {
6566
{
6667
name: 'Standard (https://github.com/standard/standard)',
6768
value: 'standard',
68-
short: 'Standard'
69+
short: 'Standard',
6970
},
7071
{
7172
name: 'Airbnb (https://github.com/airbnb/javascript)',
7273
value: 'airbnb',
73-
short: 'Airbnb'
74+
short: 'Airbnb',
7475
},
7576
{
7677
name: 'none (configure it yourself)',
7778
value: 'none',
78-
short: 'none'
79-
}
80-
]
79+
short: 'none',
80+
},
81+
],
8182
},
8283
unit: {
8384
type: 'confirm',
84-
message: 'Set up unit tests'
85+
message: 'Set up unit tests',
8586
},
8687
runner: {
8788
when: 'unit',
@@ -91,45 +92,46 @@ module.exports = {
9192
{
9293
name: 'Jest',
9394
value: 'jest',
94-
short: 'jest'
95+
short: 'jest',
9596
},
9697
{
9798
name: 'Karma and Mocha',
9899
value: 'karma',
99-
short: 'karma'
100+
short: 'karma',
100101
},
101102
{
102103
name: 'none (configure it yourself)',
103104
value: 'noTest',
104-
short: 'noTest'
105-
}
106-
]
105+
short: 'noTest',
106+
},
107+
],
107108
},
108109
e2e: {
109110
type: 'confirm',
110-
message: 'Setup e2e tests with Nightwatch?'
111+
message: 'Setup e2e tests with Nightwatch?',
111112
},
112113
autoInstall: {
113114
type: 'list',
114-
message: 'Should we run `npm install` for you after the project has been created? (recommended)',
115+
message:
116+
'Should we run `npm install` for you after the project has been created? (recommended)',
115117
choices: [
116118
{
117119
name: 'Yes, use NPM',
118120
value: 'npm',
119-
short: 'npm'
121+
short: 'npm',
120122
},
121123
{
122124
name: 'Yes, use Yarn',
123125
value: 'yarn',
124-
short: 'yarn'
126+
short: 'yarn',
125127
},
126128
{
127129
name: 'No, I will handle that myself',
128130
value: false,
129-
short: 'no'
130-
}
131-
]
132-
}
131+
short: 'no',
132+
},
133+
],
134+
},
133135
},
134136
filters: {
135137
'.eslintrc.js': 'lint',
@@ -143,27 +145,28 @@ module.exports = {
143145
'test/unit/specs/index.js': "unit && runner === 'karma'",
144146
'test/unit/setup.js': "unit && runner === 'jest'",
145147
'test/e2e/**/*': 'e2e',
146-
'src/router/**/*': 'router'
148+
'src/router/**/*': 'router',
147149
},
148-
'complete': function (data, { chalk }) {
149-
150+
complete: function(data, { chalk }) {
150151
const green = chalk.green
151152

152153
sortDependencies(data, green)
153154

154155
const cwd = path.join(process.cwd(), data.inPlace ? '' : data.destDirName)
155-
156+
156157
if (data.autoInstall) {
157158
installDependencies(cwd, data.autoInstall, green)
158-
.then(() => {
159-
return runLintFix(cwd, data, green)
160-
})
161-
.then(() => {
162-
printMessage(data, green)
163-
})
159+
.then(() => {
160+
return runLintFix(cwd, data, green)
161+
})
162+
.then(() => {
163+
printMessage(data, green)
164+
})
165+
.catch(e => {
166+
console.log(chalk.red('Error:'), e)
167+
})
164168
} else {
165169
printMessage(data, chalk)
166170
}
167-
168-
}
169-
};
171+
},
172+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli-template-webpack",
3-
"version": "1.2.6",
3+
"version": "1.2.7",
44
"license": "MIT",
55
"description": "A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction.",
66
"scripts": {

template/build/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
2222
process.stdout.write(stats.toString({
2323
colors: true,
2424
modules: false,
25-
children: false,
25+
children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build
2626
chunks: false,
2727
chunkModules: false
2828
}) + '\n\n')

template/build/webpack.base.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function resolve (dir) {
88
return path.join(__dirname, '..', dir)
99
}
1010

11-
const createLintingRule = () => ({
11+
{{#lint}}const createLintingRule = () => ({
1212
test: /\.(js|vue)$/,
1313
loader: 'eslint-loader',
1414
enforce: 'pre',
@@ -17,7 +17,7 @@ const createLintingRule = () => ({
1717
formatter: require('eslint-friendly-formatter'),
1818
emitWarning: !config.dev.showEslintErrorsInOverlay
1919
}
20-
})
20+
}){{/lint}}
2121

2222
module.exports = {
2323
context: path.resolve(__dirname, '../'),

template/config/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
// Template version: 1.2.6
2+
// Template version: 1.2.7
33
// see http://vuejs-templates.github.io/webpack for documentation.
44

55
const path = require('path')
@@ -20,13 +20,14 @@ module.exports = {
2020
notifyOnErrors: true,
2121
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
2222

23-
// Use Eslint Loader?
23+
{{#lint}}// Use Eslint Loader?
2424
// If true, your code will be linted during bundling and
2525
// linting errors and warnings will be shown in the console.
2626
useEslint: true,
2727
// If true, eslint errors and warnings will also be shown in the error overlay
2828
// in the browser.
2929
showEslintErrorsInOverlay: false,
30+
{{/lint}}
3031

3132
/**
3233
* Source Maps

template/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
"chalk": "^2.0.1",
9595
"copy-webpack-plugin": "^4.0.1",
9696
"css-loader": "^0.28.0",
97-
"eventsource-polyfill": "^0.9.6",
9897
"extract-text-webpack-plugin": "^3.0.0",
9998
"file-loader": "^1.1.4",
10099
"friendly-errors-webpack-plugin": "^1.6.1",

0 commit comments

Comments
 (0)