diff --git a/.travis.yml b/.travis.yml index 3f84391..aa89264 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,8 @@ after_success: - git config --global user.email "thuhole@users.noreply.github.com" - git remote rm origin - git remote add origin https://thuhole:${GH_TOKEN}@github.com/thuhole/webhole.git - - CI=false REACT_APP_BUILD_INFO=$(printf "Travis%s" "$(TZ=Asia/Shanghai date +"%y%m%d%H%M%S")") npm run deploy + - CI=false REACT_APP_BUILD_INFO=$(printf "Travis%s" "$(TZ=Asia/Shanghai date +"%y%m%d%H%M%S")") npm run build + - sed -i 's/\/\/cdn.jsdelivr.net\/gh\/thuhole\/webhole@gh-pages\/index.html/.\/index.html/g' build/*-* #额,这里用了个骚操作来修复Service Worker在Precache CDN内容的时候index.html返回content-type text/plain的问题 + - sed -i 's/\/\/cdn.jsdelivr.net\/gh\/thuhole\/webhole@gh-pages\/service-worker.js/.\/service-worker.js/g' build/*-* + - sed -i 's/"\/\/cdn.jsdelivr.net\/gh\/thuhole\/webhole@gh-pages","\/service-worker.js"/".","\/service-worker.js"/' build/static/js/*.js + - npm run deploy diff --git a/package.json b/package.json index 0350d24..8342d91 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "echo 'skipped react-scripts test --env=jsdom'", - "predeploy": "npm run build && sed -i 's/\\/\\/cdn\\.jsdelivr\\.net\\/gh\\/thuhole\\/webhole\\@gh\\-pages\\/index\\.html/\\.\\/index\\.html/g' build/*-*", - "predeploy_comments": "额,这里用了个骚操作来修复Service Worker在Precache CDN内容的时候index.html返回content-type text/plain的问题", + "predeploy": "", "deploy": "gh-pages -d build -m $(TZ=Asia/Shanghai date +\"%y%m%d%H%M%S\")", "eject": "react-scripts eject" },