Skip to content

Commit

Permalink
improve module transpiling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bjesus committed Sep 29, 2024
1 parent 774c13a commit 01d7bab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ footer {
<script setup>
import sanitize from "sanitize-filename";
import appConfig from "./teatime.config.ts";
import pkg from "./node_modules/sql.js-httpvfs/dist/index.js";
const { createDbWorker } = pkg;
import { createDbWorker } from "sql.js-httpvfs";
import { useLocalStorage } from "@vueuse/core";
const workerUrl = new URL(
Expand Down
17 changes: 9 additions & 8 deletions components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
</td>
<td>
{{ item.description }}

</td>
<tr><input type="radio" name="remote" @click="setRemote(item)"></tr>
<td><input type="radio" name="remote" @click="setRemote(item)" /></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -51,11 +50,13 @@ onMounted(async () => {
const setRemote = async (selection) => {
console.log(selection.full_name);
const [owner, repo] = selection.full_name.split("/")
const response = await fetch(`https://${owner}.github.io/${repo}/config.json`)
const config = await response.json()
remoteConfig.value = JSON.stringify(config)
remote.value = selection.full_name
console.log(config)
const [owner, repo] = selection.full_name.split("/");
const response = await fetch(
`https://${owner}.github.io/${repo}/config.json`,
);
const config = await response.json();
remoteConfig.value = JSON.stringify(config);
remote.value = selection.full_name;
console.log(config);
};
</script>
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineNuxtConfig({
modules: ["nuxt-lucide-icons"],
ssr: true,
build: {
transpile: ["vue-book-reader"],
transpile: ["vue-book-reader", ({ isDev }) => !isDev && "sql.js-httpvfs"],
},
vite: {
build: {
Expand Down

0 comments on commit 01d7bab

Please sign in to comment.