tinify / tinify-nodejs

Node.js client for the Tinify API.
https://tinypng.com/developers
MIT License
421 stars 74 forks source link

在vue3+nuxt3中无法使用require("tinify");导入 #43

Open SilenceYiChen opened 1 year ago

SilenceYiChen commented 1 year ago

在vue3+nuxt3中无法使用require("tinify");导入 问下是否支持在vue3中使用 node版本18.1.0 报错如下 QQ截图20230521134728

tinify-support commented 1 year ago

It is possible to import Tinify as a ES6 module as follows;

import tinify from "tinify";

Could you give it a try?

In addition, make sure to not use the tinify library in a frontend application and only in the backend. the tinify client does not support frontend integration, and all interactions should be handled by your own API.

Lukunlin commented 1 month ago

你确定你要在编译阶段运行tinify来压缩和打开图片吗?
按上面官方的回复, 这个是给nodejs后端使用的, 如果你是web端,并且在runtime阶段, 限于浏览器客户端的限制,目前这个库的nodejs版是没有做客户端的支持的