diff --git a/.gitignore b/.gitignore index 93e9743..8cd35fb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,4 @@ node_modules /deps/* !/deps/libgphoto2 !/deps/libusb -/api.o - -# Local Netlify folder -.netlify +/src/api.o diff --git a/.gitmodules b/.gitmodules index ee5de6e..0534706 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,5 +4,4 @@ branch = em [submodule "libusb"] path = deps/libusb - url = https://github.com/RReverser/libusb - branch = em + url = https://github.com/libusb/libusb diff --git a/Makefile b/Makefile index 7a1e2a5..15451c7 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export LDFLAGS += -L$(SYSROOT)/lib export ACLOCAL_PATH := $(SYSROOT)/share/aclocal:$(ACLOCAL_PATH) # Common linking flags for all targets. -export LDFLAGS += -s DYNAMIC_EXECUTION=0 -s AUTO_JS_LIBRARIES=0 -s AUTO_NATIVE_LIBRARIES=0 -s ENVIRONMENT=web,worker +export LDFLAGS += -s DYNAMIC_EXECUTION=0 -s AUTO_JS_LIBRARIES=0 -s AUTO_NATIVE_LIBRARIES=0 # Common compilation & linking flags for all langs and targets. COMMON_FLAGS = -Os -flto @@ -17,7 +17,7 @@ export LDFLAGS += $(COMMON_FLAGS) build/libapi.mjs: src/api.o $(SYSROOT)/lib/libltdl.la $(SYSROOT)/lib/libgphoto2.la libtool --verbose --mode=link $(LD) $(LDFLAGS) -o $@ $+ \ - -fexceptions --bind -s ASYNCIFY -s ALLOW_MEMORY_GROWTH \ + -fexceptions --bind -s ASYNCIFY -s ALLOW_MEMORY_GROWTH -s ENVIRONMENT=web,worker \ -dlpreopen $(SYSROOT)/lib/libgphoto2/2.5.28.1/ptp2.la \ -dlpreopen $(SYSROOT)/lib/libgphoto2_port/0.12.0/usb1.la diff --git a/package.json b/package.json index 9eb2144..284bd27 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,9 @@ "name": "web-gphoto2", "version": "0.1.0", "description": "WebAssembly implementation of gphoto2 and libusb to control DSLR cameras over USB on the Web", - "type": "module", - "main": "build/camera.js", + "exports": { + "import": "./build/camera.js" + }, "types": "build/camera.d.ts", "scripts": { "build:ts": "tsc"