chore(@vant/cli): remove lodash-es from deps (#10206)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { get } from 'lodash-es';
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { fileURLToPath, pathToFileURL } from 'url';
|
||||
import { join, dirname, isAbsolute } from 'path';
|
||||
@@ -74,7 +73,7 @@ export function getVantConfig() {
|
||||
|
||||
function getSrcDir() {
|
||||
const vantConfig = getVantConfig();
|
||||
const srcDir = get(vantConfig, 'build.srcDir');
|
||||
const srcDir = vantConfig.build?.srcDir;
|
||||
|
||||
if (srcDir) {
|
||||
if (isAbsolute(srcDir)) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { get } from 'lodash-es';
|
||||
import { existsSync } from 'fs';
|
||||
import { join, isAbsolute } from 'path';
|
||||
import { getVantConfig } from '../common/index.js';
|
||||
@@ -8,7 +7,7 @@ type CSS_LANG = 'css' | 'less' | 'scss';
|
||||
|
||||
function getCssLang(): CSS_LANG {
|
||||
const vantConfig = getVantConfig();
|
||||
const preprocessor = get(vantConfig, 'build.css.preprocessor', 'less');
|
||||
const preprocessor = vantConfig.build?.css?.preprocessor || 'less';
|
||||
|
||||
if (preprocessor === 'sass') {
|
||||
return 'scss';
|
||||
@@ -23,7 +22,7 @@ export function getCssBaseFile() {
|
||||
const vantConfig = getVantConfig();
|
||||
let path = join(STYLE_DIR, `base.${CSS_LANG}`);
|
||||
|
||||
const baseFile = get(vantConfig, 'build.css.base', '');
|
||||
const baseFile = vantConfig.build?.css?.base || '';
|
||||
if (baseFile) {
|
||||
path = isAbsolute(baseFile) ? baseFile : join(SRC_DIR, baseFile);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import fse from 'fs-extra';
|
||||
import { get } from 'lodash-es';
|
||||
import { sep, join } from 'path';
|
||||
import { SRC_DIR, getVantConfig } from './constant.js';
|
||||
import type { InlineConfig } from 'vite';
|
||||
@@ -117,7 +116,7 @@ export function smartOutputFile(filePath: string, content: string) {
|
||||
|
||||
export function mergeCustomViteConfig(config: InlineConfig) {
|
||||
const vantConfig = getVantConfig();
|
||||
const configureVite = get(vantConfig, 'build.configureVite');
|
||||
const configureVite = vantConfig.build?.configureVite;
|
||||
|
||||
if (configureVite) {
|
||||
return configureVite(config);
|
||||
|
||||
Reference in New Issue
Block a user