mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
feat(cli): support config site publicPath and outputDir
This commit is contained in:
@@ -9,7 +9,6 @@ import { getStyleExt } from './gen-package-style';
|
||||
import { ES_DIR, LIB_DIR, STYPE_DEPS_JSON_FILE } from '../common/constant';
|
||||
|
||||
function getDeps(component: string): string[] {
|
||||
// eslint-disable-next-line
|
||||
const styleDepsJson = require(STYPE_DEPS_JSON_FILE);
|
||||
|
||||
if (styleDepsJson.map[component]) {
|
||||
|
@@ -20,7 +20,6 @@ export function getStyleExt(): string {
|
||||
}
|
||||
|
||||
export function genPacakgeStyle() {
|
||||
// eslint-disable-next-line
|
||||
const styleDepsJson = require(STYPE_DEPS_JSON_FILE);
|
||||
|
||||
const ext = '.' + getStyleExt();
|
||||
|
@@ -6,7 +6,7 @@ import {
|
||||
SRC_DIR,
|
||||
DOCS_DIR,
|
||||
CONFIG_FILE,
|
||||
DESKTOP_ENTRY_FILE
|
||||
SITE_DESKTOP_SHARED_FILE
|
||||
} from '../common/constant';
|
||||
|
||||
type DocumentItem = {
|
||||
@@ -64,5 +64,5 @@ ${genExportConfig()}
|
||||
${genExportDocuments(documents)}
|
||||
`;
|
||||
|
||||
writeFileSync(DESKTOP_ENTRY_FILE, code);
|
||||
writeFileSync(SITE_DESKTOP_SHARED_FILE, code);
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
CONFIG,
|
||||
SRC_DIR,
|
||||
DIST_DIR,
|
||||
MOBILE_ENTRY_FILE
|
||||
SITE_MODILE_SHARED_FILE
|
||||
} from '../common/constant';
|
||||
|
||||
type DemoItem = {
|
||||
@@ -35,7 +35,6 @@ function genExports(demos: DemoItem[]) {
|
||||
}
|
||||
|
||||
function genConfig(demos: DemoItem[]) {
|
||||
// eslint-disable-next-line
|
||||
const demoNames = demos.map(item => decamelize(item.name, '-'));
|
||||
|
||||
CONFIG.site.nav = CONFIG.site.nav.filter((group: any) => {
|
||||
@@ -66,5 +65,5 @@ export function genSiteMobileShared() {
|
||||
const code = genCode(components);
|
||||
|
||||
ensureDirSync(DIST_DIR);
|
||||
writeFileSync(MOBILE_ENTRY_FILE, code);
|
||||
writeFileSync(SITE_MODILE_SHARED_FILE, code);
|
||||
}
|
||||
|
Reference in New Issue
Block a user