Abh*_*ana 14 web-deployment node.js npm tailwind-css vite
如何解决这个问题
我不想将index.html 放在目录tailwindcss 中。
小智 5
index.htmlVite默认寻找root 。您可以在 中更改此行为package.json。
为此,只需修改以下内容以适应...
"scripts": {
"dev": "vite serve ./src"
},
Run Code Online (Sandbox Code Playgroud)
在此示例中,我将条目index.html文件放入一个src文件夹中。我通过 告诉 Vite 此事serve,然后是相关目录(文件路径相对于项目根目录)。
在这里阅读更多内容。
您可以尝试显式指定 Rollup 使用的入口点:
// vite.config.ts
export default {
build: {
rollupOptions: {
input: {
// entry point for compilation; normally would be "./index.html"
app: '../index.html',
Run Code Online (Sandbox Code Playgroud)
但说实话,感觉就像你在与工具作斗争,你应该package.json在你的项目中建立这个目录。
| 归档时间: |
|
| 查看次数: |
17907 次 |
| 最近记录: |