mirror of
https://github.com/documenso/documenso.git
synced 2026-08-24 23:32:29 +10:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd3192d8f9 | ||
|
|
c915ca97ea | ||
|
|
478bfe3383 | ||
|
|
6f95494ad9 |
+32
-17
@@ -16,6 +16,37 @@ const require = createRequire(import.meta.url);
|
|||||||
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json'));
|
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json'));
|
||||||
const cMapsDir = normalizePath(path.join(pdfjsDistPath, 'cmaps'));
|
const cMapsDir = normalizePath(path.join(pdfjsDistPath, 'cmaps'));
|
||||||
|
|
||||||
|
const honoDevServer = serverAdapter({
|
||||||
|
entry: 'server/router.ts',
|
||||||
|
getLoadContext: async () => {
|
||||||
|
const { getLoadContext } = await import('./server/load-context');
|
||||||
|
return getLoadContext();
|
||||||
|
},
|
||||||
|
exclude: [
|
||||||
|
// Spread the defaults but replace the /.css$/ rule so that Bull
|
||||||
|
// Board's static CSS at /api/jobs/board/static/** passes through to Hono.
|
||||||
|
...devServerDefaults.exclude.map((pattern) =>
|
||||||
|
pattern instanceof RegExp && pattern.source === '.*\\.css$' ? /^(?!\/api\/jobs\/board\/).*\.css$/ : pattern,
|
||||||
|
),
|
||||||
|
'/assets/**',
|
||||||
|
'/src/app/**',
|
||||||
|
/\?(?:inline|url|no-inline|raw|import(?:&(?:inline|url|no-inline|raw)?)?)$/,
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// Restrict @hono/vite-dev-server's full-reload to backend files. Otherwise it
|
||||||
|
// fires on any SSR-loaded module change, which kills HMR for the entire app.
|
||||||
|
const honoServerDir = path.resolve(__dirname, 'server') + path.sep;
|
||||||
|
const upstreamHandleHotUpdate = honoDevServer.handleHotUpdate;
|
||||||
|
honoDevServer.handleHotUpdate = async function (ctx) {
|
||||||
|
if (!ctx.file.startsWith(honoServerDir)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return typeof upstreamHandleHotUpdate === 'function'
|
||||||
|
? upstreamHandleHotUpdate.call(this, ctx)
|
||||||
|
: upstreamHandleHotUpdate?.handler.call(this, ctx);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: We load the env variables externally so we can have runtime enviroment variables
|
* Note: We load the env variables externally so we can have runtime enviroment variables
|
||||||
* for docker.
|
* for docker.
|
||||||
@@ -45,23 +76,7 @@ export default defineConfig({
|
|||||||
macrosPlugin(),
|
macrosPlugin(),
|
||||||
lingui(),
|
lingui(),
|
||||||
tsconfigPaths(),
|
tsconfigPaths(),
|
||||||
serverAdapter({
|
honoDevServer,
|
||||||
entry: 'server/router.ts',
|
|
||||||
getLoadContext: async () => {
|
|
||||||
const { getLoadContext } = await import('./server/load-context');
|
|
||||||
return getLoadContext();
|
|
||||||
},
|
|
||||||
exclude: [
|
|
||||||
// Spread the defaults but replace the /.css$/ rule so that Bull
|
|
||||||
// Board's static CSS at /api/jobs/board/static/** passes through to Hono.
|
|
||||||
...devServerDefaults.exclude.map((pattern) =>
|
|
||||||
pattern instanceof RegExp && pattern.source === '.*\\.css$' ? /^(?!\/api\/jobs\/board\/).*\.css$/ : pattern,
|
|
||||||
),
|
|
||||||
'/assets/**',
|
|
||||||
'/src/app/**',
|
|
||||||
/\?(?:inline|url|no-inline|raw|import(?:&(?:inline|url|no-inline|raw)?)?)$/,
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
ssr: {
|
ssr: {
|
||||||
noExternal: ['react-dropzone', 'plausible-tracker'],
|
noExternal: ['react-dropzone', 'plausible-tracker'],
|
||||||
|
|||||||
Generated
-14
@@ -349,20 +349,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"apps/docs/node_modules/typescript": {
|
|
||||||
"version": "5.9.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
||||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"bin": {
|
|
||||||
"tsc": "bin/tsc",
|
|
||||||
"tsserver": "bin/tsserver"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.17"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apps/docs/node_modules/undici-types": {
|
"apps/docs/node_modules/undici-types": {
|
||||||
"version": "7.19.2",
|
"version": "7.19.2",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
|
||||||
|
|||||||
Reference in New Issue
Block a user