Skip to content

Commit cc9aa4b

Browse files
committed
Sync with latest webpack template
1 parent d41a811 commit cc9aa4b

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

meta.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ module.exports = {
5959
"short": "Standard"
6060
},
6161
{
62-
"name": "AirBNB (https://github.com/airbnb/javascript)",
62+
"name": "Airbnb (https://github.com/airbnb/javascript)",
6363
"value": "airbnb",
64-
"short": "AirBNB"
64+
"short": "Airbnb"
6565
},
6666
{
6767
"name": "none (configure it yourself)",

template/build/check-versions.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var chalk = require('chalk')
22
var semver = require('semver')
33
var packageConfig = require('../package.json')
4-
4+
var shell = require('shelljs')
55
function exec (cmd) {
66
return require('child_process').execSync(cmd).toString().trim()
77
}
@@ -12,12 +12,15 @@ var versionRequirements = [
1212
currentVersion: semver.clean(process.version),
1313
versionRequirement: packageConfig.engines.node
1414
},
15-
{
15+
]
16+
17+
if (shell.which('npm')) {
18+
versionRequirements.push({
1619
name: 'npm',
1720
currentVersion: exec('npm --version'),
1821
versionRequirement: packageConfig.engines.npm
19-
}
20-
]
22+
})
23+
}
2124

2225
module.exports = function () {
2326
var warnings = []

template/build/webpack.test.conf.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ var webpackConfig = merge(baseConfig, {
1111
rules: utils.styleLoaders()
1212
},
1313
devtool: '#inline-source-map',
14+
resolveLoader: {
15+
alias: {
16+
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
17+
// see discussion at https://github.com/vuejs/vue-loader/issues/724
18+
'scss-loader': 'sass-loader'
19+
}
20+
},
1421
plugins: [
1522
new webpack.DefinePlugin({
1623
'process.env': require('../config/test.env')

template/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"extract-text-webpack-plugin": "^2.0.0",
5555
"file-loader": "^0.11.1",
5656
"friendly-errors-webpack-plugin": "^1.1.3",
57-
"function-bind": "^1.1.0",
5857
"html-webpack-plugin": "^2.28.0",
5958
"http-proxy-middleware": "^0.17.3",
6059
"webpack-bundle-analyzer": "^2.2.1",
@@ -64,6 +63,7 @@
6463
"karma-coverage": "^1.1.1",
6564
"karma-mocha": "^1.3.0",
6665
"karma-phantomjs-launcher": "^1.0.2",
66+
"karma-phantomjs-shim": "^1.4.0",
6767
"karma-sinon-chai": "^1.3.1",
6868
"karma-sourcemap-loader": "^0.3.7",
6969
"karma-spec-reporter": "0.0.30",
@@ -84,6 +84,7 @@
8484
"selenium-server": "^3.0.1",
8585
{{/e2e}}
8686
"semver": "^5.3.0",
87+
"shelljs": "^0.7.6",
8788
"opn": "^4.0.2",
8889
"optimize-css-assets-webpack-plugin": "^1.3.0",
8990
"ora": "^1.2.0",

template/test/e2e/nightwatch.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require('babel-register')
22
var config = require('../../config')
33

4-
// http://nightwatchjs.org/getingstarted#settings-file
4+
// http://nightwatchjs.org/gettingstarted#settings-file
55
module.exports = {
66
src_folders: ['test/e2e/specs'],
77
output_folder: 'test/e2e/reports',

template/test/unit/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import Vue from 'vue'{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
22

33
Vue.config.productionTip = false{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
44

5-
// Polyfill fn.bind() for PhantomJS
6-
/* eslint-disable no-extend-native */
7-
Function.prototype.bind = require('function-bind'){{#if_eq lintConfig "airbnb"}};{{/if_eq}}
8-
95
// require all test files (files that ends with .spec.js)
106
const testsContext = require.context('./specs', true, /\.spec$/){{#if_eq lintConfig "airbnb"}};{{/if_eq}}
117
testsContext.keys().forEach(testsContext){{#if_eq lintConfig "airbnb"}};{{/if_eq}}

template/test/unit/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function (config) {
1212
// http://karma-runner.github.io/0.13/config/browsers.html
1313
// 2. add it to the `browsers` array below.
1414
browsers: ['PhantomJS'],
15-
frameworks: ['mocha', 'sinon-chai'],
15+
frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'],
1616
reporters: ['spec', 'coverage'],
1717
files: ['./index.js'],
1818
preprocessors: {

0 commit comments

Comments
 (0)