Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typings for Vite Plugin. Fix dev in Seven projects. #6733

Merged
merged 2 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/registry/news/6733.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix typings for Vite Plugin. @sneridagh
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 };
1 change: 1 addition & 0 deletions packages/seven/news/6733.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix dev in Seven projects. @sneridagh
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
Loading