sw-builder
Version:
The sw-builder package automates the creation of your Application's Service Worker, which pre-caches your build. This leads to a better overall performance and enables users to access your PWA without an Internet connection.
1 lines • 482 B
JavaScript
import{writeTextFile}from"fs-utils-sync";import{buildOutputPath,buildPrecacheAssetPaths,generateCacheName,readConfigFile}from"../utils/index.js";import{buildTemplate}from"../template/index.js";const run=({config:e="sw-builder.config.json"})=>{const t=readConfigFile(e),i=buildTemplate(t.template,generateCacheName(),buildPrecacheAssetPaths(t.outDir,t.includeToPrecache,t.excludeFilesFromPrecache),t.excludeMIMETypesFromCache);writeTextFile(buildOutputPath(t.outDir),i)};export{run};