Created by: ghost
Fixes: #24490 (closed)
I explain what I'm doing here:
-
I change the destination of 'workbox-sw' from 'assets/js/vendor' to 'assets/js/sw'. The change of destination is because I want to include the folder in 'keep_files' key of '_config.yml'.
-
I include './sw.js' in the files to exclude during build, since this file only serves as a template (it should not be copied to gh_pages, as it would overwrite the correctly generated file).
Then:
- After
docs-compile
, the workbox files are copied and the manifest is generated in gh_pages. - During
docs-serve
, Jekyll deletes all files, but keeps the files needed for the service worker.
As the current Bootstrap documentation mentions, npm run docs
must be run at least once for the service worker files to be generated.