chore: remove @demo alias

This commit is contained in:
chenjiahan
2021-09-05 12:49:04 +08:00
parent f144a6e2cd
commit f7f5c6e9b5
95 changed files with 102 additions and 109 deletions

View File

@@ -6,6 +6,7 @@ import {
getVantConfig,
smartOutputFile,
normalizePath,
isDev,
} from '../common';
import {
SRC_DIR,
@@ -79,12 +80,13 @@ function resolveDocuments(components: string[]): DocumentItem[] {
function genImportDocuments(items: DocumentItem[]) {
return items
.map(
(item) =>
`const ${
item.name
} = defineAsyncComponent(() => import('${normalizePath(item.path)}'));`
)
.map((item) => {
const path = normalizePath(item.path);
if (isDev()) {
return `const ${item.name} = defineAsyncComponent(() => import('${path}'));`;
}
return `import ${item.name} from '${path}';`;
})
.join('\n');
}

View File

@@ -18,7 +18,7 @@ type DemoItem = {
function genInstall() {
return `import packageEntry from './package-entry';
import './package-style';
import './package-style.less';
`;
}