arco-design / arco-design-pro

An out-of-the-box solution to quickly build enterprise-level applications based on Arco Design.
https://pro.arco.design
MIT License
460 stars 91 forks source link

build后index.html没有生成script标签 #96

Open ianzhi opened 1 year ago

ianzhi commented 1 year ago

Basic Info

What is expected?

正常打包

Steps to reproduce

  1. arco-cli 1.27.4
  2. Vue
  3. Arco Pro项目
  4. 完整版
  5. npm run build

Extra info

所有输出正常,生成的index.html没有引入js

jakemama commented 1 year ago

same question. i found the reason maybe configArcoResolverPlugin() in vite.config.prod.ts.

according to the issue, it may not support vite4

ianzhi commented 1 year ago

使用yarn安装依赖最终生成的html不会生成script标签,但是删除yarn.lock文件,使用npm安装依赖不会出现这个问题。

jakemama commented 1 year ago

使用yarn安装依赖最终生成的html不会生成script标签,但是删除yarn.lock文件,使用npm安装依赖不会出现这个问题。

我试了一下你的这个方法,但是build时依赖报错了

[vite:css] [postcss] Cannot find package '/Users/xxx/Desktop/demo/acro/hello-arco-pro-slim/node_modules/vite/node_modules/postcss/' imported from /Users/xxx/Desktop/demo/acro/hello-arco-pro-slim/node_modules/vite/dist/node/chunks/dep-2285ba4f.js
Did you mean to import postcss/lib/postcss.js?

然后我把vite版本降到3,用yarn也可以成功build了

imtiger commented 1 year ago

same question. i found the reason maybe configArcoResolverPlugin() in vite.config.prod.ts.

according to the issue, it may not support vite4

thanks ,it woks for m,i just downgrade vite version from 4 to 3.

pionear-layen commented 1 year ago

我的也出现了

pionear-layen commented 1 year ago

看了最新的记录,官方已解决