Skip to content

Commit

Permalink
- fix: added popup as web accessible resources (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol authored Oct 25, 2023
1 parent d5d3fcd commit 6f4a2f5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
5 changes: 3 additions & 2 deletions apps/shinkai-visor/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
"watch": true
},
"production": {
"mode": "production"
"mode": "production",
"force": true
}
}
},
"serve": {
"executor": "nx:run-commands",
"defaultConfiguration": "development",
"options": {
"command": "cd apps/shinkai-visor && npx vite"
"command": "cd apps/shinkai-visor && npx vite --force"
},
"configurations": {
"development": {
Expand Down
3 changes: 2 additions & 1 deletion apps/shinkai-visor/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"web_accessible_resources": [
{
"matches": ["https://*/*", "http://*/*", "<all_urls>"],
"resources": []
"resources": ["src/components/popup/popup.html"],
"use_dynamic_url": true
}
],
"commands": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.css" />
<link rel="stylesheet" href="/src/theme/styles.css" />
</head>
<body>
<div id="root" class="w-[300px] h-[450px]"></div>
<script type="module" src="/apps//shinkai-visor/src/components/installed-popup/installed-popup.tsx"></script>
<script type="module" src="/src/components/installed-popup/installed-popup.tsx"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions apps/shinkai-visor/src/components/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.css" />
<link rel="stylesheet" href="/src/theme/styles.css" />
</head>
<body class="w-full h-full bg-transparent">
<div id="root" class="w-full h-full"></div>
<script type="module" src="src/components/popup/popup.tsx"></script>
<script type="module" src="/src/components/popup/popup.tsx"></script>
</body>
</html>
9 changes: 7 additions & 2 deletions apps/shinkai-visor/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { crx } from "@crxjs/vite-plugin";
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import react from '@vitejs/plugin-react';
import { resolve } from 'path'
import { defineConfig } from 'vite';
import topLevelAwait from "vite-plugin-top-level-await";
import wasm from 'vite-plugin-wasm';
Expand All @@ -19,7 +20,6 @@ export default defineConfig({
allow: ['../../'],
},
},

preview: {
port: 4301,
host: 'localhost',
Expand All @@ -46,6 +46,11 @@ export default defineConfig({
},
root: './',
build: {
outDir: '../../dist/apps/shinkai-visor'
outDir: '../../dist/apps/shinkai-visor',
rollupOptions: {
input: {
popup: resolve(__dirname, 'src/components/popup/popup.html'),
},
},
},
});

0 comments on commit 6f4a2f5

Please sign in to comment.