从文件夹中将所有文件加载到Service Workers

时间:2016-05-26 16:47:10

标签: service service-worker

我正在尝试将Service Workers用于我的网站,但我没有使用此技术的经验。是否可以将整个文件夹(例如,包含所有.js / .css的文件夹)添加到this.addEventListener('install', function (event) { event.waitUntil( caches.open('v1').then(function (cache) { return cache.addAll([ '/sw-test/', '/sw-test/library/4.0/4.0/init.js', '/sw-test/library/4.0/4.0/esri/css/main.css', '/sw-test/library/4.0/4.0/dijit/themes/claro/claro.css', '/sw-test/library/4.0/4.0/', '/sw-test/index.html', '/sw-test/app.js', '/sw-test/styl.css', '/sw-test/bootstrap.css', '/sw-test/close.png' ]); }) ); ,而不是像

那样单独添加每个文件
- hosts: lnx
  tasks:
    - find: paths="/appl/scripts/inq" recurse=yes patterns="inq.Linux*"
      register: file_to_copy
    - copy: src={{ item.path }} dest=/usr/local/sbin/
      owner: root
      mode: 0775
      with_items: "{{ files_to_copy.files }}"

...

0 个答案:

没有答案