fix(config): update .smartconfig.json handling and harden bundler runtime compatibility

This commit is contained in:
2026-05-09 12:34:00 +00:00
parent f19c7c69af
commit e5b2f2ba30
18 changed files with 2712 additions and 3190 deletions
+10 -12
View File
@@ -40,29 +40,27 @@ export class AssetsHandler {
// copies the html
public async processAssets(optionsArg?: { from?: string; to?: string }) {
// lets assemble the options
optionsArg = {
...{
from: this.defaultFromDirPath,
to: this.defaultToDirPath,
},
const options = {
from: this.defaultFromDirPath,
to: this.defaultToDirPath,
...(optionsArg || {}),
};
await this.ensureAssetsDir();
optionsArg.from = plugins.smartpath.transform.toAbsolute(
optionsArg.from,
options.from = plugins.smartpath.transform.toAbsolute(
options.from,
paths.cwd,
) as string;
optionsArg.to = plugins.smartpath.transform.toAbsolute(
optionsArg.to,
options.to = plugins.smartpath.transform.toAbsolute(
options.to,
paths.cwd,
) as string;
// lets clean the target directory
const toExists = await plugins.fs.directory(optionsArg.to).exists();
const toExists = await plugins.fs.directory(options.to).exists();
if (toExists) {
await plugins.fs.directory(optionsArg.to).delete();
await plugins.fs.directory(options.to).delete();
}
await this.copyDirectoryRecursive(optionsArg.from, optionsArg.to);
await this.copyDirectoryRecursive(options.from, options.to);
}
}