farrow-vite@1.11.5 版本 dist 内容不正确
Closed this issue · 6 comments
cloudcome commented
实际结果:
// dist/vite.js
const vite = (options) => {
const router = (0, farrow_http_1.Router)();
const config = Object.assign({}, options);
let viteDevServers = [];
router.useLazy(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
^^^^^^^^^
会有以下错误:
TypeError: router.useLazy is not a function
at vite (/node_modules/farrow-vite/dist/vite.js:14:12)
期望结果:
// dist/vite.js
const vite = (options) => {
const router = (0, farrow_http_1.Router)();
const config = Object.assign({}, options);
let viteDevServers = [];
router.use(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
^^^^^
github-actions commented
Thank feedback. We will check it later:-)
Lucifier129 commented
router.useLazy
是正确的,那里就是要延迟执行。
找不到 useLazy
可能是别的原因,检查一下模块加载方式是否符合预期。
cloudcome commented
cloudcome commented
Lucifier129 commented
@tqma113 farrow-vite 里应该用 useLazy 而非 use 吧,不然每次都会创建一个 viteDevServer.
另外,farrow-http
的 Router
内部应该用 createAsyncPipeline
而非 createPipeline
,前者拓展了其它方法,如 .useLazy
。
性能优化的代码产生了 breaking change,需要逐个添加 test-cases 并加以 fix。
@cloudcome 请先回退版本并固定,后续我们修复后再放开~
tqma113 commented
Patch version released.
https://www.npmjs.com/package/farrow-http/v/1.11.3
https://www.npmjs.com/package/farrow-vite/v/1.11.6