feat(@vant/cli): using esbuild to transform script (#10143)
* feat(@vant/cli): using esbuild to transform script * chore: update babel doc * chore: update lock * chore: update * fix: format
This commit is contained in:
@@ -14,6 +14,7 @@ export const TEST_REGEXP = new RegExp('\\' + sep + 'test$');
|
||||
export const ASSET_REGEXP = /\.(png|jpe?g|gif|webp|ico|jfif|svg|woff2?|ttf)$/i;
|
||||
export const STYLE_REGEXP = /\.(css|less|scss)$/;
|
||||
export const SCRIPT_REGEXP = /\.(js|ts|jsx|tsx)$/;
|
||||
export const JSX_REGEXP = /\.(j|t)sx$/;
|
||||
export const ENTRY_EXTS = ['js', 'ts', 'tsx', 'jsx', 'vue'];
|
||||
|
||||
export function removeExt(path: string) {
|
||||
@@ -46,33 +47,14 @@ export function getComponents() {
|
||||
);
|
||||
}
|
||||
|
||||
export function isDir(dir: string) {
|
||||
return lstatSync(dir).isDirectory();
|
||||
}
|
||||
|
||||
export function isDemoDir(dir: string) {
|
||||
return DEMO_REGEXP.test(dir);
|
||||
}
|
||||
|
||||
export function isTestDir(dir: string) {
|
||||
return TEST_REGEXP.test(dir);
|
||||
}
|
||||
|
||||
export function isAsset(path: string) {
|
||||
return ASSET_REGEXP.test(path);
|
||||
}
|
||||
|
||||
export function isSfc(path: string) {
|
||||
return SFC_REGEXP.test(path);
|
||||
}
|
||||
|
||||
export function isStyle(path: string) {
|
||||
return STYLE_REGEXP.test(path);
|
||||
}
|
||||
|
||||
export function isScript(path: string) {
|
||||
return SCRIPT_REGEXP.test(path);
|
||||
}
|
||||
export const isDir = (dir: string) => lstatSync(dir).isDirectory();
|
||||
export const isDemoDir = (dir: string) => DEMO_REGEXP.test(dir);
|
||||
export const isTestDir = (dir: string) => TEST_REGEXP.test(dir);
|
||||
export const isAsset = (path: string) => ASSET_REGEXP.test(path);
|
||||
export const isSfc = (path: string) => SFC_REGEXP.test(path);
|
||||
export const isStyle = (path: string) => STYLE_REGEXP.test(path);
|
||||
export const isScript = (path: string) => SCRIPT_REGEXP.test(path);
|
||||
export const isJsx = (path: string) => JSX_REGEXP.test(path);
|
||||
|
||||
const camelizeRE = /-(\w)/g;
|
||||
const pascalizeRE = /(\w)(\w*)/g;
|
||||
|
||||
Reference in New Issue
Block a user