mirror of
https://gitee.com/dcloud/uni-preset-vue
synced 2025-04-25 14:38:55 +08:00
为普通项目增加 uni、plus 相关接口提示
This commit is contained in:
parent
498cee1cc4
commit
33bebac0f9
13
generator.js
13
generator.js
@ -32,6 +32,16 @@ async function generate (dir, files, base = '', rootOptions = {}) {
|
||||
}
|
||||
|
||||
module.exports = (api, options, rootOptions) => {
|
||||
if (options.template !== 'default-ts') {
|
||||
api.extendPackage(pkg => {
|
||||
return {
|
||||
devDependencies: {
|
||||
'@types/uni-app': '*',
|
||||
'@types/html5plus': '*'
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (options.template === 'default-ts') { // 启用 typescript
|
||||
api.extendPackage(pkg => {
|
||||
return {
|
||||
@ -41,8 +51,7 @@ module.exports = (api, options, rootOptions) => {
|
||||
},
|
||||
devDependencies: {
|
||||
'@babel/plugin-syntax-typescript': '^7.2.0',
|
||||
'@types/uni-app': '*',
|
||||
'@types/html5plus': '*',
|
||||
'@dcloudio/types': '*',
|
||||
'@vue/cli-plugin-typescript': '^3.3.0',
|
||||
'typescript': api.hasPlugin('eslint') ? '~3.1.1' : '^3.0.0'
|
||||
}
|
||||
|
@ -12,7 +12,8 @@
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
"webpack-env"
|
||||
"webpack-env",
|
||||
"@dcloudio/types/uni-app"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user