feat(includeFiles): support {from, to} object form for custom serve paths
includeFiles now accepts string | {from, to} entries. The object form
allows specifying a custom serve path (e.g. ./html/index.html -> index.html)
for base64ts bundled content.
This commit is contained in:
@@ -123,7 +123,8 @@ export class InitHandler {
|
||||
console.log(` Mode: ${bundle.outputMode || 'bundle'}`);
|
||||
console.log(` Bundler: ${bundle.bundler || 'esbuild'}`);
|
||||
if (bundle.includeFiles && bundle.includeFiles.length > 0) {
|
||||
console.log(` Include: ${bundle.includeFiles.join(', ')}`);
|
||||
const display = bundle.includeFiles.map(f => typeof f === 'string' ? f : `${f.from} -> ${f.to}`);
|
||||
console.log(` Include: ${display.join(', ')}`);
|
||||
}
|
||||
console.log('');
|
||||
});
|
||||
@@ -168,7 +169,8 @@ export class InitHandler {
|
||||
console.log(` Mode: ${preset.config.outputMode}`);
|
||||
console.log(` Bundler: ${preset.config.bundler}`);
|
||||
if (preset.config.includeFiles && preset.config.includeFiles.length > 0) {
|
||||
console.log(` Include: ${preset.config.includeFiles.join(', ')}`);
|
||||
const display = preset.config.includeFiles.map(f => typeof f === 'string' ? f : `${f.from} -> ${f.to}`);
|
||||
console.log(` Include: ${display.join(', ')}`);
|
||||
}
|
||||
|
||||
const confirmInteract = new plugins.smartinteract.SmartInteract();
|
||||
@@ -293,14 +295,14 @@ export class InitHandler {
|
||||
/**
|
||||
* Configure files to include
|
||||
*/
|
||||
private async configureIncludeFiles(prefill?: string[]): Promise<string[]> {
|
||||
const includeFiles: string[] = [];
|
||||
private async configureIncludeFiles(prefill?: interfaces.TIncludeFile[]): Promise<interfaces.TIncludeFile[]> {
|
||||
const includeFiles: interfaces.TIncludeFile[] = [];
|
||||
let addMore = true;
|
||||
|
||||
// If we have prefilled values, show them first
|
||||
if (prefill && prefill.length > 0) {
|
||||
console.log('\nPre-configured include patterns:');
|
||||
prefill.forEach((p) => console.log(` - ${p}`));
|
||||
prefill.forEach((p) => console.log(` - ${typeof p === 'string' ? p : `${p.from} -> ${p.to}`}`));
|
||||
|
||||
const keepInteract = new plugins.smartinteract.SmartInteract();
|
||||
keepInteract.addQuestions([
|
||||
|
||||
Reference in New Issue
Block a user