File tree Expand file tree Collapse file tree 3 files changed +21
-18
lines changed
Expand file tree Collapse file tree 3 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 11# Nuxt dev/build outputs
2+ .netlify
23.output
34.data
45.nuxt
Original file line number Diff line number Diff line change 1- import { join } from "node:path" ;
2- import { normalizePath } from "vite" ;
3- import { viteStaticCopy } from "vite-plugin-static-copy" ;
1+ // import { join } from "node:path";
2+ // import { normalizePath } from "vite";
3+ // import { viteStaticCopy } from "vite-plugin-static-copy";
44
55/* eslint-disable perfectionist/sort-objects */
66// https://nuxt.com/docs/api/configuration/nuxt-config
@@ -24,17 +24,17 @@ export default defineNuxtConfig({
2424 debug : true ,
2525 } ,
2626 vite : {
27- plugins : [
28- viteStaticCopy ( {
29- targets : [
30- {
31- src : normalizePath (
32- join ( __dirname , "node_modules/sql.js/dist/sql-wasm.wasm" ) ,
33- ) ,
34- dest : normalizePath ( join ( __dirname , "public " ) ) ,
35- } ,
36- ] ,
37- } ) ,
38- ] ,
27+ // plugins: [
28+ // viteStaticCopy({
29+ // targets: [
30+ // {
31+ // src: normalizePath(
32+ // join(__dirname, "node_modules/sql.js/dist/sql-wasm.wasm"),
33+ // ),
34+ // dest: normalizePath(join(__dirname, "server/assets ")),
35+ // },
36+ // ],
37+ // }),
38+ // ],
3939 } ,
4040} ) ;
Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ export const loadDatabase = async (
1111) : Promise < Database > => {
1212 try {
1313 console . log ( "Initializing SQL..." ) ;
14- const SQL = await initSqlJs ( {
15- locateFile : ( ) => origin + "/sql-wasm.wasm" ,
16- } ) ;
14+ const SQL = await initSqlJs ( ) ;
1715 console . log ( "SQL initialized" ) ;
1816 const db = new SQL . Database ( data ) ;
1917 console . log ( "Database loaded" ) ;
18+ if ( ! db ) {
19+ // @ts -expect-error - SQL.js is a module that is not typed.
20+ await import ( "sql.js/dist/sql-wasm.wasm" ) ;
21+ }
2022 return db ;
2123 } catch ( e ) {
2224 console . error ( e ) ;
You can’t perform that action at this time.
0 commit comments