chore(@vant/cli): remove webpack related deps
This commit is contained in:
@@ -28,7 +28,6 @@ export const VETUR_DIR = join(ROOT, 'vetur');
|
||||
export const SITE_DIST_DIR = join(ROOT, 'site');
|
||||
export const VANT_CONFIG_FILE = join(ROOT, 'vant.config.js');
|
||||
export const PACKAGE_JSON_FILE = join(ROOT, 'package.json');
|
||||
export const ROOT_WEBPACK_CONFIG_FILE = join(ROOT, 'webpack.config.js');
|
||||
export const ROOT_POSTCSS_CONFIG_FILE = join(ROOT, 'postcss.config.js');
|
||||
export const CACHE_DIR = join(ROOT, 'node_modules/.cache');
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ import {
|
||||
readFileSync,
|
||||
outputFileSync,
|
||||
} from 'fs-extra';
|
||||
import { merge } from 'webpack-merge';
|
||||
import { SRC_DIR, getVantConfig, ROOT_WEBPACK_CONFIG_FILE } from './constant';
|
||||
import { WebpackConfig } from './types';
|
||||
import { SRC_DIR, getVantConfig } from './constant';
|
||||
|
||||
export const EXT_REGEXP = /\.\w+$/;
|
||||
export const SFC_REGEXP = /\.(vue)$/;
|
||||
@@ -102,22 +100,6 @@ export function normalizePath(path: string): string {
|
||||
return path.replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
export function getWebpackConfig(defaultConfig: WebpackConfig): WebpackConfig {
|
||||
if (existsSync(ROOT_WEBPACK_CONFIG_FILE)) {
|
||||
const config = require(ROOT_WEBPACK_CONFIG_FILE);
|
||||
|
||||
// 如果是函数形式,可能并不仅仅是添加额外的处理流程,而是在原有流程上进行修改
|
||||
// 比如修改markdown-loader,添加options.enableMetaData
|
||||
if (typeof config === 'function') {
|
||||
return merge(defaultConfig, config(defaultConfig));
|
||||
}
|
||||
|
||||
return merge(defaultConfig, config);
|
||||
}
|
||||
|
||||
return defaultConfig;
|
||||
}
|
||||
|
||||
export type ModuleEnv = 'esmodule' | 'commonjs';
|
||||
export type NodeEnv = 'production' | 'development' | 'test';
|
||||
export type BuildTarget = 'site' | 'package';
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import type Webpack from 'webpack';
|
||||
|
||||
export type WebpackConfig = Webpack.Configuration & {
|
||||
devServer?: any;
|
||||
};
|
||||
Reference in New Issue
Block a user