kre*_*zus 17 docker dockerfile vuejs3 vite
我正在尝试对使用 vite 和 vue3 创建的前端应用程序进行 dockerize。它不作为容器工作。这是错误响应。
\n(!) 无法从 rollupOptions 或 html 文件自动确定入口点,并且没有显式的 OptimizeDeps.include 模式。跳过依赖项预捆绑。
\nVITE v3.2.4 ready in 191 ms\n\n \xc3\xa2\xc5\xbe\xc5\x93 Local: http://localhost:5173/\n \xc3\xa2\xc5\xbe\xc5\x93 Network: http://172.17.0.2:5173/\n(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.\nRun Code Online (Sandbox Code Playgroud)\nDockerfile
\n# base image\nFROM node:16.3.0-alpine\n\n# set working directory\nWORKDIR /app\n\n# add `/app/node_modules/.bin` to $PATH\nENV PATH /app/node_modules/.bin:$PATH\n\n# install and cache app dependencies\nCOPY package.json /app/package.json\nRUN npm install\nRUN npm install @vue/cli@3.7.0 -g\n# start app\nCMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]\nRun Code Online (Sandbox Code Playgroud)\nvite.config.ts
\nexport default defineConfig({\n plugins: [vue(), vueJsx()],\n resolve: {\n alias: {\n '@': fileURLToPath(new URL('./src', import.meta.url))\n }\n },\n build: {\n rollupOptions: {\n input: {\n main: resolve(__dirname, 'index.html'),\n }\n }\n }\n\n})\nRun Code Online (Sandbox Code Playgroud)\nindex.htmlvite.config.ts与和存在于同一目录中.Dockerfile。提前致谢。
小智 8
您可能正在使用该命令yarn dev run而不是yarn run dev运行开发服务器
| 归档时间: |
|
| 查看次数: |
25169 次 |
| 最近记录: |