Skip to content

Commit fcebfbc

Browse files
committed
refactor(create-plugin): move deletion of webpack directory if flag enabled to update command
1 parent cfc1420 commit fcebfbc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/create-plugin/src/commands/update.standard.command.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import chalk from 'chalk';
22
import { UDPATE_CONFIG } from '../constants.js';
3+
import { getConfig } from '../utils/utils.config.js';
34
import { printBlueBox, printRedBox } from '../utils/utils.console.js';
45
import { getOnlyExistingInCwd, removeFilesInCwd } from '../utils/utils.files.js';
56
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
@@ -23,6 +24,10 @@ export const standardUpdate = async () => {
2324
await updateGoSdkAndModules(process.cwd());
2425

2526
const filesToRemove = getOnlyExistingInCwd(UDPATE_CONFIG.filesToRemove);
27+
28+
if (Boolean(getConfig().features.useExperimentalRspack)) {
29+
filesToRemove.push('./config/webpack');
30+
}
2631
if (filesToRemove.length) {
2732
removeFilesInCwd(filesToRemove);
2833
}

packages/create-plugin/src/constants.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
3-
import { getConfig } from './utils/utils.config.js';
43

54
const __dirname = fileURLToPath(new URL('.', import.meta.url));
65

@@ -87,10 +86,7 @@ export const UDPATE_CONFIG = {
8786
// Files that should be overriden between configuration version updates.
8887
filesToOverride: ['.config/', '.cprc.json'],
8988
// Files that are no longer needed for the project and can be removed.
90-
filesToRemove: [
91-
'.config/webpack/publicPath.ts',
92-
...(Boolean(getConfig().features.useExperimentalRspack) ? ['./config/webpack'] : ['./config/rspack']),
93-
],
89+
filesToRemove: ['.config/webpack/publicPath.ts'],
9490
};
9591

9692
// prettier-ignore

0 commit comments

Comments
 (0)