简体   繁体   中英

Vue js i need to compress file to gzip and send it to the back-end

I have installed npm install compressing and i'm getting this error: how can i compress file to zip in vuejs 2.6?

Uncaught Error: Cannot find module 'fs'
    at webpackMissingModule (webpack:///./node_modules/compressing/lib/utils.js?:3)
    at Object.eval (webpack:///./node_modules/compressing/lib/utils.js?:3)
    at eval (webpack:///./node_modules/compressing/lib/utils.js?:199)
    at Object../node_modules/compressing/lib/utils.js (front.js:8020)
    at __webpack_require__ (front.js:790)
    at fn (front.js:101)
    at eval (webpack:///./node_modules/compressing/lib/zip/index.js?:3)
    at Object../node_modules/compressing/lib/zip/index.js (front.js:8044)
    at __webpack_require__ (front.js:790)
    at fn (front.js:101)

How to compress to gltf?

Compressing module is for Node. Use another package which is not dependent on filesystem like jszip

I have an answer from anther question that i had: pako (npm pako) solved my issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM