avif.js
avif.js copied to clipboard
Method of using without bundler
Is there a way to use this without a bundler (like browserify)?
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.
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.
@Kagami Would you mind show me how to pre-compiled bundles? I'm new in nodejs.
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'
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