提交 92854b84 编写于 作者: fxy060608's avatar fxy060608

feat(cli): add VUE_APP_NAME

上级 aa5a3838
...@@ -25,9 +25,10 @@ const platformOptions = manifestJsonObj[process.env.UNI_SUB_PLATFORM || process. ...@@ -25,9 +25,10 @@ const platformOptions = manifestJsonObj[process.env.UNI_SUB_PLATFORM || process.
global.uniPlugin.validate.forEach(validate => { global.uniPlugin.validate.forEach(validate => {
validate(platformOptions, manifestJsonObj) validate(platformOptions, manifestJsonObj)
}) })
process.UNI_MANIFEST = manifestJsonObj process.UNI_MANIFEST = manifestJsonObj
process.env.VUE_APP_NAME = manifestJsonObj.name
process.env.UNI_USING_V3_SCOPED = true process.env.UNI_USING_V3_SCOPED = true
process.UNI_CLOUD = false process.UNI_CLOUD = false
...@@ -68,12 +69,13 @@ if (process.env.UNI_CLOUD_SPACES) { ...@@ -68,12 +69,13 @@ if (process.env.UNI_CLOUD_SPACES) {
} }
if ( if (
process.UNI_CLOUD && process.UNI_CLOUD &&
!process.env.UNI_SUB_PLATFORM && !process.env.UNI_SUB_PLATFORM &&
process.env.UNI_PLATFORM === 'h5' && process.env.UNI_PLATFORM === 'h5' &&
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'
) { ) {
console.warn('发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5') console.warn(
'发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5')
} }
// 初始化环境变量 // 初始化环境变量
...@@ -336,8 +338,8 @@ moduleAlias.addAlias('mpvue-template-compiler', '@dcloudio/vue-cli-plugin-uni/pa ...@@ -336,8 +338,8 @@ moduleAlias.addAlias('mpvue-template-compiler', '@dcloudio/vue-cli-plugin-uni/pa
// vue-loader // vue-loader
moduleAlias.addAlias('vue-loader', '@dcloudio/vue-cli-plugin-uni/packages/vue-loader') moduleAlias.addAlias('vue-loader', '@dcloudio/vue-cli-plugin-uni/packages/vue-loader')
if (process.env.UNI_USING_V3 && process.env.UNI_PLATFORM === 'app-plus') { if (process.env.UNI_USING_V3 && process.env.UNI_PLATFORM === 'app-plus') {
moduleAlias.addAlias('./runtime/getUrl.js', '@dcloudio/vue-cli-plugin-uni/lib/app-plus/getUrl.js') moduleAlias.addAlias('./runtime/getUrl.js', '@dcloudio/vue-cli-plugin-uni/lib/app-plus/getUrl.js')
moduleAlias.addAlias('../runtime/getUrl.js', '@dcloudio/vue-cli-plugin-uni/lib/app-plus/getUrl.js') moduleAlias.addAlias('../runtime/getUrl.js', '@dcloudio/vue-cli-plugin-uni/lib/app-plus/getUrl.js')
moduleAlias.addAlias('vue-style-loader', '@dcloudio/vue-cli-plugin-uni/packages/app-vue-style-loader') moduleAlias.addAlias('vue-style-loader', '@dcloudio/vue-cli-plugin-uni/packages/app-vue-style-loader')
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册