Skip to content

Commit ea298a1

Browse files
committed
use babel-preset-latest instead of env, use .postcssrc
1 parent 8224eaa commit ea298a1

File tree

6 files changed

+24
-11
lines changed

6 files changed

+24
-11
lines changed

template/.babelrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"presets": [
3-
["env", { "modules": false }],
3+
["latest", {
4+
"es2015": { "modules": false }
5+
}],
46
"stage-2"
57
],
68
"plugins": ["transform-runtime"],
79
"comments": false,
810
"env": {
911
"test": {
10-
"presets": ["env", "stage-2"],
12+
"presets": ["latest", "stage-2"],
1113
"plugins": [ "istanbul" ]
1214
}
1315
}

template/.postcssrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
// to edit target browsers: use "browserlist" field in package.json
6+
"autoprefixer": {}
7+
}
8+
}

template/build/vue-loader.conf.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,5 @@ module.exports = {
88
? config.build.productionSourceMap
99
: config.dev.cssSourceMap,
1010
extract: isProduction
11-
}),
12-
postcss: [
13-
require('autoprefixer')({
14-
browsers: ['last 2 versions']
15-
})
16-
]
11+
})
1712
}

template/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{{/lint}}
2525
"babel-loader": "^6.2.10",
2626
"babel-plugin-transform-runtime": "^6.22.0",
27-
"babel-preset-env": "^1.1.8",
27+
"babel-preset-latest": "^6.22.0",
2828
"babel-preset-stage-2": "^6.22.0",
2929
"babel-register": "^6.22.0",
3030
"chalk": "^1.1.3",
@@ -98,5 +98,10 @@
9898
"engines": {
9999
"node": ">= 4.0.0",
100100
"npm": ">= 3.0.0"
101-
}
101+
},
102+
"browserlist": [
103+
"> 1%",
104+
"last 2 versions",
105+
"not ie <= 8"
106+
]
102107
}

template/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import App from './App'{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
88
import router from './router'{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
99
{{/router}}
1010

11-
Vue.devtool.productionTip = false{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
11+
Vue.config.productionTip = false{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
1212

1313
/* eslint-disable no-new */
1414
new Vue({

template/test/unit/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import Vue from 'vue'{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
2+
Vue.config.productionTip = false{{#if_eq lintConfig "airbnb"}};{{/if_eq}}
3+
14
// Polyfill fn.bind() for PhantomJS
25
/* eslint-disable no-extend-native */
36
Function.prototype.bind = require('function-bind'){{#if_eq lintConfig "airbnb"}};{{/if_eq}}

0 commit comments

Comments
 (0)