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

Update to webp-hero 0.0.0-dev.26 #9

Open
alexisbmills opened this issue Sep 14, 2020 · 5 comments
Open

Update to webp-hero 0.0.0-dev.26 #9

alexisbmills opened this issue Sep 14, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@alexisbmills
Copy link
Collaborator

Update to the latest version of webp-hero.

@alexisbmills alexisbmills added the enhancement New feature or request label Sep 14, 2020
@alexisbmills
Copy link
Collaborator Author

Currently blocked by error, after updating, when running demo:

WARNING in ./node_modules/webp-hero/libwebp/dist/webp.js
Module not found: Error: Can't resolve 'crypto' in 'ngx-webp-polyfill\node_modules\webp-hero\libwebp\dist'


ERROR in ./node_modules/webp-hero/libwebp/dist/webp.js
Module not found: Error: Can't resolve 'fs' in 'ngx-webp-polyfill\node_modules\webp-hero\libwebp\dist'

ERROR in ./node_modules/webp-hero/libwebp/dist/webp.js
Module not found: Error: Can't resolve 'path' in 'ngx-webp-polyfill\node_modules\webp-hero\libwebp\dist'

Possible workarounds include:

Both workarounds need to be implemented in the consumer application (not in ngx-webp-polyfill) which is not ideal :(

@alexisbmills alexisbmills self-assigned this Sep 14, 2020
@chase-moskal
Copy link

@alexisbmills

it looks like you're using libwebp directly, so be sure to take a peek at the new webp-hero readme section about that

it's possible that instead of using
  webp-hero/libwebp/dist/webp.js

you may need to use
  webp-hero/libwebp/dist/webp.cjs.js

see webp-hero/libwebp/dist/

@alexisbmills
Copy link
Collaborator Author

alexisbmills commented Sep 16, 2020

Hi @chase-moskal.

Currently we go as deep as importing WebpMachine - import { WebpMachine } from 'webp-hero'; which has import {Webp} from "../libwebp/dist/webp.js" (https://github.com/chase-moskal/webp-hero/blob/master/source/webp-machine.ts#L2).

It's not ideal for this project to be using CJS, in terms of bundle size, although I haven't done a comparison of the ESM/CJS bundle results. Reference https://angular.io/guide/build#configuring-commonjs-dependencies.

@chase-moskal
Copy link

@alexisbmills oh, i see

this issue might be a regression in webp-hero. i think it may be this issue

i'm thinking in webp-hero, we'd need to add ENVIRONMENT = web somewhere like here in the dockerfile or maybe here in cmakelists

@chase-moskal
Copy link

@alexisbmills i may have found the problem. i reopened chase-moskal/webp-hero#40 about it and explained more in my post there

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

No branches or pull requests

2 participants