Skip to content

Commit 2e78cc5

Browse files
author
linfeng
committed
feat: add ensure files config
1 parent 6e2e28e commit 2e78cc5

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/utils/define.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ export class ProjectConfig {
262262
* Project Root Dom Id
263263
*/
264264
public projectRootId = 'root';
265+
266+
/**
267+
* Enable ensure files
268+
*/
269+
public ensureFiles = true;
265270
}
266271

267272
export type SetPipe = (pipeName: string, callback: PipeCallback) => void;

src/utils/ensure-files.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { priEvent } from './pri-events';
77
import { freshGlobalState, globalState } from './global-state';
88

99
export const ensureFiles = async () => {
10+
if (!globalState.sourceConfig.ensureFiles) {
11+
return;
12+
}
13+
1014
priEvent.emit('beforeEnsureFiles');
1115

1216
const ensureProjectFilesQueueGroupByPath = _.groupBy(plugin.ensureProjectFilesQueue, 'fileName');

0 commit comments

Comments
 (0)