I'm currently attempting to add a service worker that does a bit more then just caching and doesn't some decompression on the worker. The decompression I'm running I have already tested and have it working outside of the service worker (just inside a fetch) without a problem. This decompression is done by the draco3D library (https://github.com/google/draco). When I attempt to load this library into my service worker I get the following error:
Module not found: Error: Can't resolve 'fs' in '/node_modules/draco3d'
Steps to reproduce
create a service worker (sw.js) and configure it follow fusionjs documents
add draco3d to the project
update src/sw.js to import draco import draco3d from 'draco3d';
I'm currently attempting to add a service worker that does a bit more then just caching and doesn't some decompression on the worker. The decompression I'm running I have already tested and have it working outside of the service worker (just inside a fetch) without a problem. This decompression is done by the draco3D library (https://github.com/google/draco). When I attempt to load this library into my service worker I get the following error:
Module not found: Error: Can't resolve 'fs' in '/node_modules/draco3d'
Steps to reproduce
import draco3d from 'draco3d';
fusion-cli version: ^1.18.3
Node.js version (
node --version
): v8.12.0npm version (
npm --version
): 6.4.1Operating System: linux (ubuntu 14)