简体   繁体   English

有没有办法可以在 visual studio code IDE 和 Live 服务器之外运行我的 tailwind CSS 网站?

[英]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.

相关问题 您可以在 Live 服务器扩展 Visual Studio 代码中链接子页面吗 - Can you link subpages in Live server extension Visual studio code 如何在 Visual Studio Code 中查看实时服务器上的两个 html 页面? - How Can I View Two html pages on live server in Visual Studio Code? 如何将Visual Studio代码上的本地网站推送到在Azure上部署的Webapp - How can I push my local website on visual studio code to a webapp I deployed on Azure Visual Studio Code Live Server 看起来很棒,但 CSS 未在浏览器中加载 - Visual Studio Code Live Server looks great, but CSS doesn't load in browser 为什么 Live Server 不能从 Visual Studio 预览我的 CSS? - Why Live Server doesn't preview my CSS from Visual Studio? 如何在Visual Studio中的网站上使用控制台应用程序? - How can I use a console application with my website in Visual Studio? 如何在 Visual Studio Code 中运行这个 JavaScript 蛇游戏? - How can I run this JavaScript snake game in Visual Studio Code? 如何在 Laravel 代码之前加载 CSS? 使用顺风 - How can i load the CSS before the Laravel code? Using Tailwind 视觉工作室代码将在实时服务器中显示图像但是当我直接打开浏览器时没有图像 - visual studio code will show images in live server but when I open directly into browser no images 有什么办法可以覆盖网站的“ CSS主题”? - Is there a way I can overwrite the 'CSS Theme' for my Website?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM