2017-01-30 51 views
1

林对我的进步作出反应的应用程序,在离线模式下,我从cacheStorage得到模板,但它不是获取的CSS或JS。不知道我会出错哪里。SW-预缓存脱机模式不获取JS和CSS

enter image description here

enter image description here

new SWPrecacheWebpackPlugin({ 
     cacheId: 'example-app', 
     filename: 'sw.js', 
     // minify: true, 
     runtimeCaching: [{ 
     urlPattern: '/', 
     handler: 'cacheFirst', 
     }], 
     dynamicUrlToDependencies: { 
     '/': ['./server/views/index.ejs'], 
     }, 
    }), 
+0

有同样的问题进出口... – Villanuevand

+0

我有查询字符串版本的资产,我删除其似乎工作。我需要在另一个环境中测试它。 –

回答

1

我下面通过加入固定的问题,这忽略了URL参数。

ignoreUrlParametersMatching: [/./],