Skip to content

How to pre-process the service worker with Parcel? #22

@jtojnar

Description

@jtojnar

I have some imports, as well as some other modern JavaScript features in the ServiceWorker but they are not processed by Parcel/Babel – the generated file still contains:

import {skipWaiting} from 'workbox-core';
import {precacheAndRoute} from 'workbox-routing';

How to make Parcel to process the file?

I am using the following config:

  "cache": {
    "strategy": "inject",
    "swSrc": "./js/selfoss-sw-offline.js",
    "templatedURLs": {},
    "swDest": "service-worker.js"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions