mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-05-04 19:10:01 -05:00
2a195f0298
close #1202, close #1204
67 lines
1.3 KiB
JavaScript
67 lines
1.3 KiB
JavaScript
module.exports = (api, options) => {
|
|
api.render('./template')
|
|
|
|
api.extendPackage({
|
|
scripts: {
|
|
'serve': 'vue-cli-service serve' + (
|
|
// only auto open browser on MacOS where applescript
|
|
// can avoid dupilcate window opens
|
|
process.platform === 'darwin'
|
|
? ' --open'
|
|
: ''
|
|
),
|
|
'build': 'vue-cli-service build'
|
|
},
|
|
dependencies: {
|
|
'vue': '^2.5.16'
|
|
},
|
|
devDependencies: {
|
|
'vue-template-compiler': '^2.5.16'
|
|
},
|
|
'postcss': {
|
|
'plugins': {
|
|
'autoprefixer': {}
|
|
}
|
|
},
|
|
browserslist: [
|
|
'> 1%',
|
|
'last 2 versions',
|
|
'not ie <= 8'
|
|
]
|
|
})
|
|
|
|
if (options.router) {
|
|
require('./router')(api, options)
|
|
}
|
|
|
|
if (options.vuex) {
|
|
require('./vuex')(api, options)
|
|
}
|
|
|
|
if (options.cssPreprocessor) {
|
|
const deps = {
|
|
sass: {
|
|
'node-sass': '^4.9.0',
|
|
'sass-loader': '^7.0.1'
|
|
},
|
|
less: {
|
|
'less': '^3.0.4',
|
|
'less-loader': '^4.1.0'
|
|
},
|
|
stylus: {
|
|
'stylus': '^0.54.5',
|
|
'stylus-loader': '^3.0.2'
|
|
}
|
|
}
|
|
|
|
api.extendPackage({
|
|
devDependencies: deps[options.cssPreprocessor]
|
|
})
|
|
}
|
|
|
|
// additional tooling configurations
|
|
if (options.configs) {
|
|
api.extendPackage(options.configs)
|
|
}
|
|
}
|