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 747e42e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASE_URL='/'
VUE_APP_PUBLIC_PATH='/'
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASE_URL='/'
VUE_APP_PUBLIC_PATH='//fastly.jsdelivr.net/gh/webees/tfjs-yolov8@cf-pages/'
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/utils/tf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { yolo } from '@/vue-pinia'

export function loadModel() {
tf.ready().then(async () => {
const model = await tf.loadGraphModel(`/${yolo().name}_web_model/model.json`, {
const model = await tf.loadGraphModel(`${process.env.VUE_APP_PUBLIC_PATH}/${yolo().name}_web_model/model.json`, {
onProgress: progress => {
console.log('tf.loadGraphModel', progress)
yolo().loading = progress
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: process.env.VUE_APP_PUBLIC_PATH,
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 747e42e

Please sign in to comment.