如何将 bootstrap 5 和其他全局包添加到 SvelteKit 项目中?

How to add bootstrap 5 and other global packages to a SvelteKit project?

我使用 NPM

安装了 bootstrap

在正常的 svelte 项目中,我通常会在 App.ts 文件中添加 bootstrap 和其他在项目范围内使用的包.但是,在 SvelteKit 项目中没有主入口点。

那么将 bootstrap 5 或其他 packages 添加到 SvelteKit[ 的推荐方法是什么? =30=] 全球?

我不想使用汇总插件,只想将其作为 模块 导入 JavaScript

您可以制作一个顶级 __layout 并在那里导入所有内容。

我添加这个是因为这似乎是将包添加到 SvelteKit 应用程序的好方法。

https://github.com/svelte-add/svelte-add

如果你想添加 Bootstrap 例如使用

npx svelte-add@latest bootstrap

截至撰写本文之日,还没有很多软件包,希望将来会发生变化。