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

Method of using without bundler #4

Open
lionirdeadman opened this issue Jun 14, 2019 · 5 comments
Open

Method of using without bundler #4

lionirdeadman opened this issue Jun 14, 2019 · 5 comments

Comments

@lionirdeadman
Copy link

Is there a way to use this without a bundler (like browserify)?

@Kagami
Copy link
Owner

Kagami commented Jun 14, 2019

It was possible some time ago, but then I split codebase a bit for easier maintainability. You may check out earlier commits.

I will consider providing pre-compiled bundles though.

@lionirdeadman
Copy link
Author

I've tried V1 but it seems it doesn't work with my AVIFs that I made with your go-avif tool while it does in the demo, I've not been able to see which commit changed it from not needing a bundler to needing one, if you could point to that it'd be nice.

Although, Pre-compiled bundles would be better. I would really appreciate it.

@hoangvietfreelancer
Copy link

@Kagami Would you mind show me how to pre-compiled bundles? I'm new in nodejs.

@sycured
Copy link

sycured commented Aug 26, 2022

Have you successfully used this library without a bundler or using browserify from the cli?

Actually, I'm at this step:

browserify reg.js -o bundle.js

/Volumes/MHDCS/git_repositories/github/xyz/node_modules/avif.js/avif.js:78
export function register(regPromise, opts) {
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

@kenvix
Copy link

kenvix commented Jun 15, 2023

Have you successfully used this library without a bundler or using browserify from the cli?

Actually, I'm at this step:

browserify reg.js -o bundle.js

/Volumes/MHDCS/git_repositories/github/xyz/node_modules/avif.js/avif.js:78
export function register(regPromise, opts) {
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

@sycured You need to use esmify to add ES Modules support to browserify:

npm install esmify browser-resolve
browserify reg.js  -p esmify -o avif-bundle.js

Note that you also need to run browserify for avif-sw.js

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

No branches or pull requests

5 participants