service worker
Service Worker 服务工作是一个网络缓存机制,可以把浏览器和服务器之间的数据传递进行缓存和服务。
类似于一个离线服务器。
看代码是最好的办法
service-worker.js var cacheName = 'cp-work-ts-vue'; var filesToCache = [ '/', '/main.js', '/css/*.css', '/assets/img/*.JPG' ]; self.addEventListener('install', function(e) { console.log('[ServiceWorker] Install'); e.waitUntil( caches.open(cacheName).then(function(cache) { console.log('[ServiceWorker] Caching app shell'); return cache.addAll(filesToCache); }) ); }); self.addEventListener('activate', function(e) { console.log('[ServiceWorker] Activate'); e.waitUntil( caches.keys().then(function(keyList) { return Promise.all(keyList.map(function(key) { if (key !== cacheName) { console.log('[ServiceWorker] Removing old cache', key); return caches.delete(key); } })); }) ); return self.clients.claim(); }); self.addEventListener('fetch', function(e) { console.log('[ServiceWorker] Fetch', e.
Introduction webpack is a bundler for modules. The main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
TL; DR
Bundles both CommonJs and AMD modules (even combined). Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time). Dependencies are resolved during compilation reducing the runtime size.
using-orgmode-in-emacs.org
— templateKey: blog-post|doc-page title: "using-orgmode-in-emacs.org" author: "Xing Wenju" description: "Some Description" date: "2018-02-16T20:03:50-04:00" tags:
hugo emacs —
the super org is the module of emacs Org-mode is a fabulous organizational tool originally built by Carsten Dominik that operates on plain text files. Org-mode is part of Emacs.
This document assumes you've had some exposure to org-mode already so concepts like the agenda, capture mode, etc. won't be completely foreign to you.