Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 将@celljs/cli-common中使用了ts-node的地方,改为使用importx-tsup包进行动态require #211 #212

Merged
merged 6 commits into from
Oct 20, 2024

Conversation

Groupguanfang
Copy link
Contributor

本来想直接使用importx的,发现importx没有提供CommonJS产物,于是我便自己fork了一份importx,移除掉unbuild改为使用tsup编译出CommonJS产物,发包到了npm:importx-tsup

@muxiangqiu 您也可以去改一份发npm,要不然importx无法在celljs中正常使用。现在这个版本是没问题的,可以直接执行yarn workspace @celljs/example-backend-app start进行测试,控制台能完美打印出webpack-hook字样。

Copy link
Member

@muxiangqiu muxiangqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看看这些问题

return obj.default;
} else if (typeof obj === 'object' && typeof obj.default === 'function') {
return obj;
} else {return obj; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {return obj; } 不建议放成一行

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{return obj; } 缺少空格 { return obj; }

@Groupguanfang
Copy link
Contributor Author

由于使用了importx,目前尝试完善一个vitesse模版。目前大概完善了50%左右:

  • ✅unplugin-auto-import:正常工作
  • ✅unplugin-vue-router:正常工作
  • ✅unplugin-vue-components:正常工作
  • ✅unplugin-vue-markdown:通过修改了vue webpack loader的加载顺序,得以正常工作
  • ❌@intlify/unplugin-vue-i18n:不能正常工作,似乎与html插件冲突,无论如何调准顺序都不能正常工作
  • ❌vite-plugin-vue-layouts:这是一个vite插件,无法在webpack环境运行,准备计划开一个仓库,能否给这个插件给迁移到unplugin上,使webpack端也能正常使用
  • ❌unplugin-vue-macros:目前没有计划把vue中更高级的macros迁移过来
  • ❌vite-plugin-vue-devtools:一样是一个vite插件,但是开发者可以安装chrome插件替代(目前还是beta版本,但是基本可用)
  • ❌vite-ssg:vite插件,这个是vitesse的核心,但是webpack下仍然不能用😭

Copy link
Member

@muxiangqiu muxiangqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看看

return obj.default;
} else if (typeof obj === 'object' && typeof obj.default === 'function') {
return obj;
} else return obj;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else return obj; 改成如下:

} else {
return obj;
}

},
"devDependencies": {
"@celljs/cli": "3.0.0",
"@celljs/cli-service": "3.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@celljs/cli-service": "3.0.0",

这个依赖可以不用添加

@Groupguanfang
Copy link
Contributor Author

没毛病

@muxiangqiu muxiangqiu changed the title refactor: 将@celljs/cli-common中使用了ts-node的地方,改为使用importx-tsup包进行动态require refactor: 将@celljs/cli-common中使用了ts-node的地方,改为使用importx-tsup包进行动态require #211 Oct 20, 2024
@muxiangqiu muxiangqiu merged commit 5c0f692 into cellbang:main Oct 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants