ERROR [vite]: Rollup failed to resolve import "/src/main.ts" from "/app/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to build.rollupOptions.external
ERROR error during build:
Error: [vite]: Rollup failed to resolve import "/src/main.ts" from "/app/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to build.rollupOptions.external
at viteWarn (file:///app/node_modules/.store/[email protected]/node_modules/vite/dist/node/chunks/dep-a8e37fae.js:48070:27)
at onRollupWarning (file:///app/node_modules/.store/[email protected]/node_modules/vite/dist/node/chunks/dep-a8e37fae.js:48102:9)
at onwarn (file:///app/node_modules/.store/[email protected]/node_modules/vite/dist/node/chunks/dep-a8e37fae.js:47830:13)
at file:///app/node_modules/.store/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:24070:13
at Object.logger [as onLog] (file:///app/node_modules/.store/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:25742:9)
at ModuleLoader.handleInvalidResolvedId (file:///app/node_modules/.store/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:24656:26)
at file:///app/node_modules/.store/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:24616:26
here is the dockerfile:
FROM node:lts-alpine
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
RUN cnpm install -g http-server
WORKDIR /app
COPY package*.json ./
RUN cnpm install
COPY . .
RUN cnpm run build
EXPOSE 8080
CMD [ "http-server", "dist"]