Rollup Setup / Migration

This commit is contained in:
Felix Kaspar
2024-01-26 16:26:04 +01:00
parent c07e247a2a
commit bcb8ff5843
17 changed files with 1288 additions and 1820 deletions

View File

@@ -3,9 +3,6 @@
"version": "0.0.0",
"main": "index.ts",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"imports": {
"#pdfcpu": "./src/wasm/pdfcpu/pdfcpu-wrapper.server.js"
},

View File

@@ -2,7 +2,9 @@ import i18next from "i18next";
import resourcesToBackend from "i18next-resources-to-backend";
i18next
.use(resourcesToBackend((language, namespace) => import(`./locales/${namespace}/${language}.json`)))
.use(resourcesToBackend((language, namespace) => import(`./public/locales/${namespace}/${language}.json`, {
assert: { type: "json" },
})))
.init({
// debug: true,
ns: ["common"], // Preload this namespace, no need to add the others, they will load once their module is loaded

View File

@@ -2,7 +2,7 @@ import { WasmFs } from '@wasmer/wasmfs';
import path from "path";
import { fileURLToPath } from 'url';
let nodeWasmLocation = path.dirname(fileURLToPath(import.meta.url));
let nodeWasmLocation = "./dist/public/wasm/pdfcpu/"; // TODO: Replace with __dirname
let fs;
const wasmfs = new WasmFs();

View File

@@ -1,5 +1,6 @@
{
"compilerOptions": {
"module": "Node16",
"esModuleInterop": true,
"baseUrl": "./src", /* Specify the base directory to resolve non-relative module names. */
"paths": {