Skip to content

Commit

Permalink
cf-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
webees committed Sep 16, 2023
1 parent 83b1170 commit 34098ce
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BASE_URL='yolo8.pages.dev'
VUE_APP_BASE_URL='/'
2 changes: 1 addition & 1 deletion .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
BRANCH: cf-pages
FOLDER: dist
2 changes: 1 addition & 1 deletion src/registerServiceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { register } from 'register-service-worker'

if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
register(`/service-worker.js`, {
ready() {
console.log('App is being served from cache by a service worker.\n' + 'For more details, visit https://goo.gl/AFskqB')
},
Expand Down
2 changes: 1 addition & 1 deletion src/vue-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const routes: Array<RouteRecordRaw> = [
]

const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
history: createWebHistory('/'),
routes,
linkActiveClass: 'active',
scrollBehavior(to, from, savedPosition) {
Expand Down
7 changes: 6 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const vueServe = c => {
}

const vueConfig = {
publicPath: IS_DEV ? '/' : '//fastly.jsdelivr.net/gh/webees/tfjs-yolov8@gh-pages/',
publicPath: IS_DEV ? '/' : '//fastly.jsdelivr.net/gh/webees/tfjs-yolov8@cf-pages/',
outputDir: 'dist',
productionSourceMap: IS_DEV,
integrity: false,
Expand All @@ -50,6 +50,11 @@ const vueConfig = {
open: false,
proxy: null
},
pwa: {
manifestOptions: {
start_url: '/'
}
},
configureWebpack: {
externals: {
'vue-router': 'VueRouter',
Expand Down

0 comments on commit 34098ce

Please sign in to comment.