mirror of
https://github.com/zadam/trilium.git
synced 2026-02-01 11:24:25 +01:00
fix(client): relative import to src
This commit is contained in:
parent
4a8fa7293b
commit
6de632d117
@ -19,7 +19,7 @@ if (isDev) {
|
||||
plugins = [
|
||||
viteStaticCopy({
|
||||
targets: assets.map((asset) => ({
|
||||
src: `src/${asset}/*`,
|
||||
src: `${asset}/*`,
|
||||
dest: asset
|
||||
}))
|
||||
}),
|
||||
@ -27,7 +27,7 @@ if (isDev) {
|
||||
structured: true,
|
||||
targets: [
|
||||
{
|
||||
src: "../../node_modules/@excalidraw/excalidraw/dist/prod/fonts/*",
|
||||
src: "../../../node_modules/@excalidraw/excalidraw/dist/prod/fonts/*",
|
||||
dest: "",
|
||||
}
|
||||
]
|
||||
@ -37,8 +37,8 @@ if (isDev) {
|
||||
}
|
||||
|
||||
export default defineConfig(() => ({
|
||||
root: __dirname,
|
||||
cacheDir: '../../.cache/vite',
|
||||
root: join(__dirname, "src"),
|
||||
cacheDir: join(__dirname, "../../.cache/vite"),
|
||||
base: "",
|
||||
plugins,
|
||||
// Use esbuild for JSX transformation (much faster than Babel)
|
||||
@ -79,14 +79,14 @@ export default defineConfig(() => ({
|
||||
},
|
||||
build: {
|
||||
target: "esnext",
|
||||
outDir: './dist',
|
||||
outDir: '../dist',
|
||||
emptyOutDir: true,
|
||||
reportCompressedSize: true,
|
||||
sourcemap: false,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
index: join(__dirname, "src", "index.html"),
|
||||
login: join(__dirname, "src", "login.ts"),
|
||||
login: join(__dirname, "src", "login.ts"),
|
||||
setup: join(__dirname, "src", "setup.ts"),
|
||||
set_password: join(__dirname, "src", "set_password.ts"),
|
||||
runtime: join(__dirname, "src", "runtime.ts"),
|
||||
|
||||
@ -47,11 +47,11 @@ async function register(app: express.Application) {
|
||||
vite.middlewares(req, res, next);
|
||||
});
|
||||
app.get(`/`, [ rootLimiter, auth.checkAuth, csrfMiddleware ], (req, res, next) => {
|
||||
req.url = `/${assetUrlFragment}/src/index.html`;
|
||||
req.url = `/${assetUrlFragment}/index.html`;
|
||||
vite.middlewares(req, res, next);
|
||||
});
|
||||
app.get(`/index.ts`, [ rootLimiter ], (req, res, next) => {
|
||||
req.url = `/${assetUrlFragment}/src/index.ts`;
|
||||
req.url = `/${assetUrlFragment}/index.ts`;
|
||||
vite.middlewares(req, res, next);
|
||||
});
|
||||
app.use(`/node_modules/@excalidraw/excalidraw/dist/prod`, persistentCacheStatic(path.join(srcRoot, "../../node_modules/@excalidraw/excalidraw/dist/prod")));
|
||||
@ -66,7 +66,7 @@ async function register(app: express.Application) {
|
||||
// broken when closing the browser and coming back in to the page.
|
||||
// The page is restored from cache, but the API call fail.
|
||||
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
res.sendFile(path.join(publicDir, "src", "index.html"));
|
||||
res.sendFile(path.join(publicDir, "index.html"));
|
||||
});
|
||||
app.use("/assets", persistentCacheStatic(path.join(publicDir, "assets")));
|
||||
app.use(`/src`, persistentCacheStatic(path.join(publicDir, "src")));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user