feat(cli): add npmextra-based compile target configuration for deno builds
This commit is contained in:
@@ -10,8 +10,10 @@ tsdenoCli.standardCommand().subscribe(async (argvArg) => {
|
||||
console.log(`@git.zone/tsdeno v${commitinfo.version}`);
|
||||
console.log('');
|
||||
console.log('Usage:');
|
||||
console.log(' tsdeno compile [deno compile args...] Compile with package.json isolation');
|
||||
console.log(' tsdeno compile Compile all targets from npmextra.json');
|
||||
console.log(' tsdeno compile [deno compile args...] Compile with explicit args (passthrough)');
|
||||
console.log('');
|
||||
console.log('When no args are given, tsdeno reads compileTargets from npmextra.json.');
|
||||
console.log('The compile command temporarily removes package.json before running');
|
||||
console.log('deno compile, preventing devDependencies from bloating the binary.');
|
||||
console.log('--node-modules-dir=none is added automatically.');
|
||||
@@ -19,11 +21,15 @@ tsdenoCli.standardCommand().subscribe(async (argvArg) => {
|
||||
|
||||
tsdenoCli.addCommand('compile').subscribe(async (argvArg) => {
|
||||
const tsDeno = new TsDeno();
|
||||
|
||||
// Pass through all args after "compile" to deno compile
|
||||
const rawArgs = process.argv.slice(3);
|
||||
|
||||
await tsDeno.compile(rawArgs);
|
||||
if (rawArgs.length === 0) {
|
||||
// No args — read targets from npmextra.json
|
||||
await tsDeno.compileFromConfig();
|
||||
} else {
|
||||
// Args provided — passthrough to deno compile
|
||||
await tsDeno.compile(rawArgs);
|
||||
}
|
||||
});
|
||||
|
||||
export { tsdenoCli };
|
||||
|
||||
Reference in New Issue
Block a user