Match-id-599b1f351f38afaf0126ce9149f1c9aad71655c4
This commit is contained in:
commit
e507035f8e
|
@ -53,7 +53,6 @@ class BasicGenerator extends Generator {
|
|||
readStream.pipe(writeStream);
|
||||
readStream.on('error', err => console.error(err));
|
||||
writeStream.on('error', err => console.error(err));
|
||||
// writeStream.on('finish', () => console.log(`Copied ${src} to ${dest}`));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,6 @@ export default (api: any) => {
|
|||
api.applyHook({ name: 'beforeCompile', args: state });
|
||||
state.forEach((s: any) => {
|
||||
webpack(s.config, (err: any, stats: any) => {
|
||||
// api.applyHook({ name: 'afterCompile' });
|
||||
if (err || stats.hasErrors()) {
|
||||
api.logger.error(`Build failed.err: ${err}, stats:${stats}`);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export default (api: API) => {
|
|||
|
||||
if (api.userConfig.devBuildConfig.devProxy) {
|
||||
devServerOptions.onBeforeSetupMiddleware = (devServer: WebpackDevServer) => {
|
||||
setupProxy(devServer.app, api)
|
||||
setupProxy(devServer.app, api);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ export default (api: API) => {
|
|||
api.applyHook({ name: 'afterStartDevServer' });
|
||||
});
|
||||
} else {
|
||||
api.logger.error("Can't find config");
|
||||
api.logger.error('Can\'t find config');
|
||||
}
|
||||
break;
|
||||
case 'vite':
|
||||
|
@ -71,9 +71,10 @@ export default (api: API) => {
|
|||
server.printUrls();
|
||||
});
|
||||
} else {
|
||||
api.logger.error("Can't find config");
|
||||
api.logger.error('Can\'t find config');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
@ -42,6 +42,8 @@ export default (api: API) => {
|
|||
args._.shift();
|
||||
const isESM = api.packageJson['type'] === 'module';
|
||||
await generateJest(args, api.cwd, isESM);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
@ -191,13 +191,7 @@ export default class Hub {
|
|||
}
|
||||
} else {
|
||||
this.userConfig.buildConfig.forEach((userBuildConfig) => {
|
||||
// if (typeof userBuildConfig === 'string') {
|
||||
// const name = this.getConfigName(userBuildConfig);
|
||||
// this.buildConfigPath.push({name, path: userBuildConfig});
|
||||
// }
|
||||
if (typeof userBuildConfig === 'object') {
|
||||
// const name = userBuildConfig.name;
|
||||
// const path = userBuildConfig.path;
|
||||
this.buildConfigPath.push(userBuildConfig);
|
||||
}
|
||||
})
|
||||
|
|
|
@ -18,7 +18,6 @@ import fs from 'fs';
|
|||
import { build as esbuild, Plugin } from 'esbuild';
|
||||
|
||||
const buildConfig = async (fileName: string, format: 'esm' | 'cjs' = 'esm'): Promise<string> => {
|
||||
|
||||
// 外部依赖不构建参与构建,减少执行时间
|
||||
const pluginExternalDeps: Plugin = {
|
||||
name: 'plugin-external-deps',
|
||||
|
|
|
@ -93,8 +93,8 @@ function generateRoutes(app: any) {
|
|||
respond instanceof Function
|
||||
? respond
|
||||
: (_req: any, res: { send: (arg0: any) => void }) => {
|
||||
res.send(respond);
|
||||
}
|
||||
res.send(respond);
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
|
|
@ -127,7 +127,6 @@ function copyFiles(copyPairs) {
|
|||
name: 'copy-files',
|
||||
generateBundle() {
|
||||
copyPairs.forEach(({ from, to }) => {
|
||||
console.log(`copy files: ${from} → ${to}`);
|
||||
fs.copyFileSync(from, to);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -19,9 +19,9 @@ import { Props } from '../utils/Interface';
|
|||
function getInitValue(dom: HTMLInputElement, props: Props) {
|
||||
const { value, defaultValue, checked, defaultChecked } = props;
|
||||
|
||||
const defaultValueStr = defaultValue != null ? defaultValue : '';
|
||||
const initValue = value != null ? value : defaultValueStr;
|
||||
const initChecked = checked != null ? checked : defaultChecked;
|
||||
const defaultValueStr = defaultValue !== null && defaultValue !== undefined ? defaultValue : '';
|
||||
const initValue = value !== null && value !== undefined ? value : defaultValueStr;
|
||||
const initChecked = checked !== null && checked !== undefined ? checked : defaultChecked;
|
||||
|
||||
return { initValue, initChecked };
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ function getInitValue(props: Props) {
|
|||
let initValue = defaultValue;
|
||||
|
||||
// children content存在时,会覆盖defaultValue
|
||||
if (children != null) {
|
||||
if (children !== null && children !== undefined) {
|
||||
// 子节点不是纯文本,则取第一个子节点
|
||||
initValue = children instanceof Array ? children[0] : children;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ export function updateTextareaValue(dom: HTMLTextAreaElement, props: Props, isIn
|
|||
} else {
|
||||
// 获取当前节点的 value 值
|
||||
let value = props.value;
|
||||
if (value != null) {
|
||||
if (value !== null && value !== undefined) {
|
||||
value = String(value);
|
||||
// 当且仅当值实际发生变化时才去设置节点的value值
|
||||
if (dom.value !== value) {
|
||||
|
|
Loading…
Reference in New Issue