fix: 打包修改

This commit is contained in:
熊潇 2024-10-24 09:36:57 +08:00
parent c832c0274a
commit f182838a2d
5 changed files with 14 additions and 4 deletions

View File

@ -1,2 +1,4 @@
#!/usr/bin/env node
import '../dist/index.js';
import { runParser } from '../dist/index.js';
runParser(process.argv);

View File

@ -13,7 +13,7 @@
"bin"
],
"scripts": {
"dev": "tsx src/index.ts ",
"dev": "tsx src/run.ts ",
"build": "rimraf dist && rollup -c",
"b": "./bin/envision.js"
},

View File

@ -27,5 +27,5 @@ export default {
declaration: false,
}), // 使用 @rollup/plugin-typescript 处理 TypeScript 文件
],
external: ['sqlite3', 'sequelize'], // 将 sqlite3 作为外部依赖
external: ['sqlite3', 'sequelize', 'vite'], // 将 sqlite3 作为外部依赖
};

View File

@ -9,4 +9,9 @@ import './command/config.ts';
import './command/web.ts';
import './command/router.ts';
program.parse(process.argv);
// program.parse(process.argv);
export const runParser = async (argv: string[]) => {
// program.parse(process.argv);
program.parse(argv);
};

3
src/run.ts Normal file
View File

@ -0,0 +1,3 @@
import { runParser } from './index.ts';
runParser(process.argv);