无法从 rollupOptions 自动确定入口点

2024-06-19

我正在尝试对使用 vite 和 vue3 创建的前端应用程序进行 dockerize。它不作为容器工作。这是错误响应。

(!) 无法从 rollupOptions 或 html 文件自动确定入口点,并且没有显式的 OptimizeDeps.include 模式。跳过依赖项预捆绑。

VITE v3.2.4  ready in 191 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: http://172.17.0.2:5173/
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

Dockerfile

# base image
FROM node:16.3.0-alpine

# set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /app/package.json
RUN npm install
RUN npm install @vue/[email protected] /cdn-cgi/l/email-protection -g
# start app
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]

vite.config.ts

export default defineConfig({
    plugins: [vue(), vueJsx()],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    build: {
        rollupOptions: {
            input: {
                main: resolve(__dirname, 'index.html'),
            }
        }
    }

})

index.html存在于同一目录中vite.config.ts and .Dockerfile。提前致谢。


您可能正在使用命令yarn dev run代替yarn run dev运行开发服务器

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法从 rollupOptions 自动确定入口点 的相关文章

随机推荐