[英]Is there a way I can run my tailwind CSS website outside the visual studio code IDE and Live server?
I created a website using HTML, JS and tailwind CSS.我使用 HTML、JS 和顺风 CSS 创建了一个网站。 The tailwind CSS was installed using the CLI tool following the procedures in the documentation and is working fine when the page is executed with live server in Visual Studio Code.
tailwind CSS 是按照文档中的步骤使用 CLI 工具安装的,当页面在 Visual Studio Code 中使用实时服务器执行时工作正常。
npm install -D tailwindcss
and then created a tailwindcss.config.js with然后创建了一个 tailwindcss.config.js
npx tailwindcss init
Now the problem is, how do I share this whole website to a friend so that he can simply run the index.html file and he sees a completely working website running the tailwindcss code too without him having to install and configure tailwindcss.现在的问题是,我如何将整个网站分享给朋友,这样他就可以简单地运行 index.html 文件,他也可以看到一个运行 tailwindcss 代码的完全正常的网站,而无需安装和配置 tailwindcss。 Or if there is a way to export the project with all installed packages.
或者,如果有一种方法可以导出包含所有已安装包的项目。 Because so far, it just runs the plain html code whenever I try to share the whole project or even if I simply try to execute the page outside VsCode.
因为到目前为止,只要我尝试共享整个项目,或者即使我只是尝试在 VsCode 之外执行页面,它也只会运行纯 html 代码。
Perhaps a possible solution to share is to host a live project on an online editor, this example uses Vite to build an environment for Tailwind and Vanilla JavaScript, it does not have much configurations but can be forked to try.或许分享一个可能的解决方案是在在线编辑器上托管一个实时项目,这个 例子使用 Vite 为 Tailwind 和 Vanilla JavaScript 构建环境,它没有太多配置但可以 fork 尝试。
If other tools are preferred, consider start a new project in such online editor from a template with Tailwind, or start a new Node.js project and use the terminal to install needed packages.如果首选其他工具,请考虑使用 Tailwind 从模板在此类在线编辑器中启动一个新项目,或者启动一个新的 Node.js 项目并使用终端安装所需的包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.