mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): skip install should not skip export
This commit is contained in:
parent
8e8892b323
commit
0858c0499e
@ -28,22 +28,20 @@ function genExports(names: string[]): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function genPackageEntry(options: Options) {
|
export function genPackageEntry(options: Options) {
|
||||||
|
const names = getComponents();
|
||||||
const vantConfig = getVantConfig();
|
const vantConfig = getVantConfig();
|
||||||
const components = getComponents();
|
const skipInstall = get(vantConfig, 'build.skipInstall', []).map(pascalize);
|
||||||
const skipInstall = get(vantConfig, 'build.skipInstall', []);
|
|
||||||
|
|
||||||
const names = components
|
const components = names.map(pascalize);
|
||||||
.filter(item => !skipInstall.includes(item))
|
const content = `${genImports(names, options)}
|
||||||
.map(item => pascalize(item));
|
|
||||||
|
|
||||||
const content = `${genImports(components, options)}
|
|
||||||
|
|
||||||
const version = '${version}';
|
const version = '${version}';
|
||||||
const components = [
|
|
||||||
${names.join(',\n ')}
|
|
||||||
];
|
|
||||||
|
|
||||||
function install(Vue) {
|
function install(Vue) {
|
||||||
|
const components = [
|
||||||
|
${components.filter(item => !skipInstall.includes(item)).join(',\n ')}
|
||||||
|
];
|
||||||
|
|
||||||
components.forEach(item => {
|
components.forEach(item => {
|
||||||
if (item.install) {
|
if (item.install) {
|
||||||
Vue.use(item);
|
Vue.use(item);
|
||||||
@ -60,7 +58,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|||||||
export {
|
export {
|
||||||
install,
|
install,
|
||||||
version,
|
version,
|
||||||
${genExports(names)}
|
${genExports(components)}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user