From 4a8b2a7eb2aa0e6f77b6c74b8deb45b230a82730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B1=89=E6=88=90?= Date: Wed, 16 May 2018 23:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Unify=20service-worker=20env=20u?= =?UTF-8?q?rl=20format=20(#483)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use utils.find() * unify url format --- lib/graph-service-worker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/graph-service-worker.js b/lib/graph-service-worker.js index 3df83416..7bd00501 100644 --- a/lib/graph-service-worker.js +++ b/lib/graph-service-worker.js @@ -113,8 +113,10 @@ function fileEnv (state) { ] var style = [`${state.styles.bundle.hash.toString('hex').slice(0, 16)}/bundle.css`] var assets = split(state.assets.list.buffer) - var doc = split(state.documents.list.buffer) - var manifest = ['/manifest.json'] + var doc = split(state.documents.list.buffer).map(function (url) { + return url.slice(1) + }) + var manifest = ['manifest.json'] var files = [].concat(script, style, assets, doc, manifest) files = files.filter(function (file) {