Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build 未进行压缩 #1134

Closed
klouskingsley opened this issue Mar 27, 2018 · 10 comments
Closed

npm run build 未进行压缩 #1134

klouskingsley opened this issue Mar 27, 2018 · 10 comments
Labels

Comments

@klouskingsley
Copy link

klouskingsley commented Mar 27, 2018

  • wepy version: [在package.json里] 1.6.0
@klouskingsley
Copy link
Author

刚开始是这样:

[WARNING] 找不到插件:wepy-plugin-uglifyjs。
[17:16:55] [信息] 检测到有效NPM包资源,正在尝试安装,请稍等。
npmup to date in 3.22s
 WARN wechat-live@1.0.0 No repository field.

[17:17:00] [完成] 已完成安装 wepy-plugin-uglifyjs,重新启动编译。

后来手动安装 wepy-plugin-uglifyjs, wepy-plugin-imagemin后压缩成功了

@qianzhaoy
Copy link

我也是这样,可是自动安装好 wepy-plugin-uglifyjs 后, 只有wxss压缩了。 JS 还是原样。
请问你执行 npm run build 后,dist 文件夹里的 js 是压缩状态的吗

@klouskingsley
Copy link
Author

js是压缩状态的

@qianzhaoy
Copy link

@klouskingsley 必须 wepy-plugin-uglifyjs, wepy-plugin-imagemin 两个都安装了才可以,bash里只提示安装 wepy-plugin-uglifyjs ,所以我一直不行。。

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jun 1, 2018

插件是在wepy.config.js里面配置的。比如你不需要压缩图片,你就把那个imagemin去掉就行了。

@klouskingsley 默认他会进行手动安装,如果安装失败可能就是因为网络原因导致不通,所以需要自动安装。

@Julyyq
Copy link

Julyyq commented Jan 7, 2019

如果运行npm run build发现JS没有压缩,那么需要先安装npm install wepy-plugin-imagemin --save-dev, 然后重新运行npm run build就可以了。

@huhai122
Copy link

我 imagemin 和uglifyjs 都--save-dev了 run build 正常 就是js没编译

@kekemao
Copy link

kekemao commented Jun 14, 2019

运行 npm run build 时 出现警告如下,但是实际上图片路径是没问题的,是什么原因导致警告呢
[WARNING] Error: Error in file: D:/hisunpay/act-balance-query-wxminiprogram/src/images/close.png

The system cannot find the path specified

@Teemwu
Copy link

Teemwu commented Dec 29, 2020

@kekemao 我也遇到同样问题,重装 wepy-plugin-imagemin 就好了,感谢 @Julyyq 的回答

@cvpv
Copy link

cvpv commented Jan 31, 2023

2023年,wepy1最新版,按照官方安装的1.72 wepy init standard myproject ,官方demo还是有这个问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants