Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build 阶段构建目录清空时机 #81

Open
ClarkXia opened this issue Dec 24, 2021 · 0 comments
Open

build 阶段构建目录清空时机 #81

ClarkXia opened this issue Dec 24, 2021 · 0 comments

Comments

@ClarkXia
Copy link
Collaborator

configArr.forEach(v => {
try {
const userBuildPath = v.chainConfig.output.get('path');
const buildPath = path.resolve(rootDir, userBuildPath);
fs.emptyDirSync(buildPath);
} catch (e) {
if (fs.existsSync(defaultPath)) {
fs.emptyDirSync(defaultPath);
}
}
});
const webpackConfig = configArr.map(v => v.chainConfig.toConfig());
await applyHook(`before.${command}.run`, {

目前会在 before.build.load 之后,before.build.run 之前删除,对于开发者通过自定义钩子往构建目录添加内容会有一定的认知成本,希望优化成执行 build 整体逻辑之前进行清空

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant