All Projects → idiotWu → sw-loader

idiotWu / sw-loader

Licence: MIT license
Yet another service worker loader

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sw-loader

ez-s
⚠️ [discontinued] Run a green-badge local HTTPS server with zero configuration; no certificate creation, no tunnels and no hassle.
Stars: ✭ 10 (-47.37%)
Mutual labels:  service-worker
cnode-react
a web app for cnode.org with react + react-router + react-redux
Stars: ✭ 23 (+21.05%)
Mutual labels:  service-worker
ember-app-shell
No description or website provided.
Stars: ✭ 23 (+21.05%)
Mutual labels:  service-worker
elfloader
ARMv7M ELF loader
Stars: ✭ 71 (+273.68%)
Mutual labels:  loader
react-native-modal-loader
Customizable animated modal progress hud for react apps.
Stars: ✭ 36 (+89.47%)
Mutual labels:  loader
nautilus.js
[separated fork] Async JavaScript loader & dependency manager in ~600B [gziped]
Stars: ✭ 59 (+210.53%)
Mutual labels:  loader
favloader
Vanilla JavaScript library for loading animation in favicon (favicon loader)
Stars: ✭ 20 (+5.26%)
Mutual labels:  loader
tips
Here is what you need to setup your progressive web app dev environment
Stars: ✭ 14 (-26.32%)
Mutual labels:  service-worker
react-calculator
📐 PWA React + Redux Calculator
Stars: ✭ 65 (+242.11%)
Mutual labels:  service-worker
vue-load-image
A Vue component for showing loader during image loading https://john015.github.io/vue-load-image/
Stars: ✭ 60 (+215.79%)
Mutual labels:  loader
gdmod
A mod loader and modding API for GDevelop games.
Stars: ✭ 15 (-21.05%)
Mutual labels:  loader
ex loader
Load a single beam file, apps (a set of beams), or an erlang release (a set of apps) to a node.
Stars: ✭ 12 (-36.84%)
Mutual labels:  loader
magento-meanbee-pwa
Progressive Web App extension for Magento 1
Stars: ✭ 75 (+294.74%)
Mutual labels:  service-worker
forthehorde
My Grunt being setup for frontend development
Stars: ✭ 16 (-15.79%)
Mutual labels:  service-worker
YaEtl
Yet Another ETL in PHP
Stars: ✭ 60 (+215.79%)
Mutual labels:  loader
spendlogs
SpendLogs - Personal Expense Manager
Stars: ✭ 18 (-5.26%)
Mutual labels:  service-worker
requirex
A different kind of module loader 📦🦖
Stars: ✭ 20 (+5.26%)
Mutual labels:  loader
chicio.github.io
👻 Fabrizio Duroni (me 😄) personal website. Created using GatsbyJS, Styled Components, Storybook, Typescript, tsParticles, GitHub pages, Github Actions, Upptime.
Stars: ✭ 20 (+5.26%)
Mutual labels:  service-worker
fastify-loader
The route loader for the cool kids!
Stars: ✭ 17 (-10.53%)
Mutual labels:  loader
affilicats
🐈 Progressive Web App demo that showcases flaky network resilience measures (📶 or 🚫📶).
Stars: ✭ 65 (+242.11%)
Mutual labels:  service-worker

sw-loader

npm Travis License

Yet another Service Workers loader for webpack.

Install

npm install --save-dev sw-loader

Usage

This loader emits a standalone service worker file and exports the entry point.

import scriptURL from 'sw-loader!./sw.js';
// => 'scriptURL = {output.publicPath}/sw.js'
// => file location: {output.path}/sw.js

navigator.serviceWorker.register(scriptURL).then(...);

Options

name

Specify the name of output file:

import scriptURL from 'sw-loader?name=my-worker.js!./sw.js';
// => 'scriptURL = {output.publicPath}/my-worker.js'
// => file location: {output.path}/my-worker.js

Notice: this loader DOES NOT support filename interpolation, for the reason that a service worker is considered as a persistent resource.

outputPath

By default the output path follows output.path option in webpack configurations, you can change it to anywhere you like.

The outputPath will be resolved to project root.

import scriptURL from 'sw-loader?outputPath=build/workers/!./sw.js';
// => 'scriptURL = {output.publicPath}/sw.js'
// => file location: build/workers/sw.js

The outputPath modifies only the output destination, if you want to change the access URL address of service worker script, use the publicPath option below.

publicPath

By default this loader uses output.publicPath to concatenate the public URL address of service worker script, you can modify it by:

import scriptURL from 'sw-loader?publicPath=/!./sw.js';
// => 'scriptURL = /sw.js'
// => file location: {output.path}/sw.js

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].