mirror of
https://github.com/musistudio/claude-code-router.git
synced 2026-02-02 06:40:50 +08:00
support docker
This commit is contained in:
@@ -7,18 +7,27 @@ const fs = require('fs');
|
||||
console.log('Building Server package...');
|
||||
|
||||
try {
|
||||
const serverDir = path.join(__dirname, '../packages/server');
|
||||
|
||||
// Create dist directory
|
||||
const distDir = path.join(__dirname, '../packages/server/dist');
|
||||
const distDir = path.join(serverDir, 'dist');
|
||||
if (!fs.existsSync(distDir)) {
|
||||
fs.mkdirSync(distDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Generate type declaration files
|
||||
console.log('Generating type declaration files...');
|
||||
execSync('tsc --emitDeclarationOnly', {
|
||||
stdio: 'inherit',
|
||||
cwd: serverDir
|
||||
});
|
||||
|
||||
// Build the server application
|
||||
console.log('Building server application...');
|
||||
// 使用 minify 和 tree-shaking 优化体积
|
||||
execSync('esbuild src/index.ts --bundle --platform=node --minify --tree-shaking=true --outfile=dist/index.js', {
|
||||
stdio: 'inherit',
|
||||
cwd: path.join(__dirname, '../packages/server')
|
||||
cwd: serverDir
|
||||
});
|
||||
|
||||
// Copy the tiktoken WASM file
|
||||
|
||||
Reference in New Issue
Block a user