@winfe/vmi
Version:
49 lines (39 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _react() {
const data = _interopRequireDefault(require("react"));
_react = function _react() {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = api => {
const cwd = api.cwd;
api.describe({
key: 'materialDemo',
config: {
schema(joi) {
return joi.object();
},
default: {}
}
});
api.modifyConfig(initialValue => {
const _api$pkg$componentCon = api.pkg.componentConfig,
name = _api$pkg$componentCon.name,
title = _api$pkg$componentCon.title,
category = _api$pkg$componentCon.category,
domain = _api$pkg$componentCon.domain;
if (!name || !title || !category || !domain || !name.split('/').length) {
throw new Error('物料的config不全,请检查');
}
initialValue.publicPath = `/material-demos/${category}/${name.split('/')[1]}/`;
initialValue.base = `/material-demos/${category}/${name.split('/')[1]}/`;
return initialValue;
});
};
exports.default = _default;