mischnic / parcel-plugin-sw-cache

📦👷 Parcel plugin for caching using a service worker
https://npm.im/parcel-plugin-sw-cache
MIT License
47 stars 6 forks source link

swDest does not respect swDest from config. #8

Closed dsych closed 6 years ago

dsych commented 6 years ago

When strategy is set to inject, swDest variable is not overwritten for link replacement logic, which results in code trying to locate default file. The following exception is thrown:

sw-cache: Service worker injection failed: Error: No files match the pattern: path-to-your-file/sw.js

Suggested fix:

then(() =>
        files: swConfig.swDest ? swConfig.swDest : swDest ,
        from: /__PUBLIC/g,
        to: publicURL,
    });
)
mischnic commented 6 years ago

Both fixes released as 0.2.4.