bugfix: yarn仓库镜像,点击切换回原生时,原生按钮不亮的问题修复
parent
68c0ea5d5d
commit
5ece1b3612
|
@ -11,7 +11,7 @@ module.exports = {
|
||||||
cafile: false,
|
cafile: false,
|
||||||
NODE_EXTRA_CA_CERTS: false,
|
NODE_EXTRA_CA_CERTS: false,
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: false,
|
NODE_TLS_REJECT_UNAUTHORIZED: false,
|
||||||
yarnRegistry: undefined,
|
yarnRegistry: 'null',
|
||||||
registry: 'https://registry.npmjs.org'// 可以选择切换官方或者淘宝镜像
|
registry: 'https://registry.npmjs.org'// 可以选择切换官方或者淘宝镜像
|
||||||
},
|
},
|
||||||
// intercepts: {
|
// intercepts: {
|
||||||
|
|
|
@ -44,7 +44,7 @@ const NodePlugin = function (context) {
|
||||||
|
|
||||||
const cmds = []
|
const cmds = []
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
if (item.value != null) {
|
if (item.value != null && item.value.length > 0 && item.value !== 'null') {
|
||||||
cmds.push(`${command} config set ${item.key} ${item.value}`)
|
cmds.push(`${command} config set ${item.key} ${item.value}`)
|
||||||
} else {
|
} else {
|
||||||
cmds.push(`${command} config delete ${item.key}`)
|
cmds.push(`${command} config delete ${item.key}`)
|
||||||
|
@ -67,7 +67,7 @@ const NodePlugin = function (context) {
|
||||||
const cmds = []
|
const cmds = []
|
||||||
log.debug('yarn set:', JSON.stringify(list))
|
log.debug('yarn set:', JSON.stringify(list))
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
if (item.value != null) {
|
if (item.value != null && item.value.length > 0 && item.value !== 'null') {
|
||||||
cmds.push(`yarn config set ${item.key} ${item.value}`)
|
cmds.push(`yarn config set ${item.key} ${item.value}`)
|
||||||
} else {
|
} else {
|
||||||
cmds.push(`yarn config delete ${item.key}`)
|
cmds.push(`yarn config delete ${item.key}`)
|
||||||
|
|
|
@ -7,7 +7,7 @@ const level = process.env.NODE_ENV === 'development' ? 'debug' : 'info'
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const filename = path.join(getDefaultConfigBasePath(), '/logs/core.log')
|
const filename = path.join(getDefaultConfigBasePath(), '/logs/core.log')
|
||||||
log4js.configure({
|
log4js.configure({
|
||||||
appenders: { std: { type: 'stdout' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename} },
|
appenders: { std: { type: 'stdout' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename } },
|
||||||
categories: { default: { appenders: ['file', 'std'], level: level } }
|
categories: { default: { appenders: ['file', 'std'], level: level } }
|
||||||
})
|
})
|
||||||
const logger = log4js.getLogger('core')
|
const logger = log4js.getLogger('core')
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
plugin: {
|
plugin: {
|
||||||
node: {
|
node: {
|
||||||
setting: {
|
setting: {
|
||||||
yarnRegistry: null,
|
yarnRegistry: 'null',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
git: {
|
git: {
|
||||||
|
|
|
@ -44,8 +44,8 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="yarn仓库镜像" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form-item label="yarn仓库镜像" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-radio-group v-model="config.plugin.node.setting.yarnRegistry" :default-value="null" @change="onSwitchYarnRegistry" button-style="solid">
|
<a-radio-group v-model="config.plugin.node.setting.yarnRegistry" :default-value="'null'" @change="onSwitchYarnRegistry" button-style="solid">
|
||||||
<a-radio-button :value="null">
|
<a-radio-button :value="'null'">
|
||||||
yarn原生
|
yarn原生
|
||||||
</a-radio-button>
|
</a-radio-button>
|
||||||
<a-radio-button value="https://registry.npmmirror.com">
|
<a-radio-button value="https://registry.npmmirror.com">
|
||||||
|
|
Loading…
Reference in New Issue