Skip to content

Commit

Permalink
Fix typings for Vite Plugin. Fix dev in Seven projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Feb 8, 2025
1 parent fd185a1 commit f6f5121
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
26 changes: 22 additions & 4 deletions packages/registry/vite-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import { ConfigType } from './dist';
import * as vite from 'vite';

declare function PloneRegistryVitePlugin(): vite.Plugin;
export function PloneRegistryVitePlugin(): {
name: string;
enforce: 'pre' | 'post' | undefined;
config: () => {
ssr: {
optimizeDeps: {
exclude: string[];
};
};
esbuild: {
supported: {
'top-level-await': boolean;
};
};
optimizeDeps: {
exclude: string[];
};
resolve: {
alias: any[];
};
};
};

declare module '@plone/registry/addons-loader' {
export default function applyAddonConfiguration(
config: ConfigType,
): ConfigType;
}

export { PloneRegistryVitePlugin };
5 changes: 5 additions & 0 deletions packages/seven/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default defineConfig({
plugins: [PloneRegistryVitePlugin(), reactRouter(), tsconfigPaths()],
server: {
port: 3000,
fs: {
// Allow serving files from one level up to the project root
// (required by the Cookieplone setup)
allow: ['../../../.'],
},
proxy: {
'^/\\+\\+api\\+\\+($$|/.*)': {
target: prodServerName
Expand Down

0 comments on commit f6f5121

Please sign in to comment.