2017-01-30 56 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: [/./],