Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1befb90
feat: plugin hook filters
florian-lefebvre Dec 10, 2025
c383f54
wip
florian-lefebvre Dec 10, 2025
3feb29f
wip
florian-lefebvre Dec 10, 2025
5a5acbb
wip
florian-lefebvre Dec 10, 2025
c37813a
wip
florian-lefebvre Dec 10, 2025
3901a73
wip
florian-lefebvre Dec 10, 2025
fb6e01d
wip
florian-lefebvre Dec 10, 2025
e87df8d
wip
florian-lefebvre Dec 10, 2025
93c8cb2
wip
florian-lefebvre Dec 10, 2025
a3da79c
wip
florian-lefebvre Dec 10, 2025
e95e37e
wip
florian-lefebvre Dec 10, 2025
8f72ee4
wip
florian-lefebvre Dec 10, 2025
db456d0
wip
florian-lefebvre Dec 10, 2025
c76daa3
todos
florian-lefebvre Dec 10, 2025
e5a0b19
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 10, 2025
bf3a9ed
fix
florian-lefebvre Dec 10, 2025
8750f02
fix: vite plugin config alias
florian-lefebvre Dec 10, 2025
8b23c66
feat: load
florian-lefebvre Dec 10, 2025
ecbb025
fix: misc
florian-lefebvre Dec 10, 2025
46e78fc
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 10, 2025
e95d8e0
fix: regex
florian-lefebvre Dec 10, 2025
a358b76
fix: regex
florian-lefebvre Dec 10, 2025
da1cacd
fix: regex
florian-lefebvre Dec 10, 2025
6e5f017
fix: regex
florian-lefebvre Dec 11, 2025
4fa4903
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 11, 2025
477d1ab
fix: regex
florian-lefebvre Dec 11, 2025
863606e
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 11, 2025
5870997
fix: regex
florian-lefebvre Dec 11, 2025
3dc7098
improve regex
florian-lefebvre Dec 11, 2025
71a0b26
fix: unsufficient regex
florian-lefebvre Dec 11, 2025
fa7a8db
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 11, 2025
e362a45
chore: format
florian-lefebvre Dec 12, 2025
d0cae56
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 12, 2025
69bcb45
chore: format
florian-lefebvre Dec 12, 2025
dacba07
wip
florian-lefebvre Dec 12, 2025
547f756
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 15, 2025
4c44b63
feat: plugin hook filters (part 2) (#15000)
florian-lefebvre Dec 15, 2025
4c5f2f3
Merge branch 'next' into feat/plugin-hook-filters
florian-lefebvre Dec 15, 2025
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
Prev Previous commit
Next Next commit
wip
  • Loading branch information
florian-lefebvre committed Dec 10, 2025
commit e95e37e59104a6bc5493418ca0827d6a301947ad
26 changes: 14 additions & 12 deletions packages/astro/test/ssr-adapter-build-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@ describe('Integration buildConfig hook', () => {
vite: {
plugins: [
{
resolveId(id) {
if (id === '@my-ssr') {
return id;
} else if (id === 'astro/app') {
const viteId = viteID(
new URL('../dist/core/app/index.js', import.meta.url),
);
return viteId;
}
// TODO: check if @my-ssr check is useful
resolveId: {
filter: {
id: /^astro\/app$/,
},
handler() {
return viteID(new URL('../dist/core/app/index.js', import.meta.url));
},
},
load(id) {
if (id === '@my-ssr') {
load: {
filter: {
id: /^@my-ssr$/,
},
handler() {
return `import { App } from 'astro/app';export function createExports(manifest) { return { manifest, createApp: () => new App(manifest) }; }`;
}
},
},
},
],
Expand Down
24 changes: 14 additions & 10 deletions packages/astro/test/test-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ export default function ({
vite: {
plugins: [
{
resolveId(id) {
if (id === '@my-ssr') {
return id;
} else if (id === 'astro/app') {
const viteId = viteID(new URL('../dist/core/app/index.js', import.meta.url));
return viteId;
}
// TODO: check if @my-ssr check is useful
resolveId: {
filter: {
id: /^astro\/app$/,
},
handler() {
return viteID(new URL('../dist/core/app/index.js', import.meta.url));
},
},
load(id) {
if (id === '@my-ssr') {
load: {
filter: {
id: /^@my-ssr$/,
},
handler() {
return {
code: `
import { App, AppPipeline } from 'astro/app';
Expand Down Expand Up @@ -102,7 +106,7 @@ export default function ({
}
`,
};
}
},
},
},
],
Expand Down
18 changes: 12 additions & 6 deletions packages/integrations/alpinejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ function virtualEntrypoint(options?: Options): Plugin {
: options.entrypoint;
}
},
resolveId(id) {
if (id === virtualModuleId) {
resolveId: {
filter: {
id: new RegExp(`^${virtualModuleId}$`),
},
handler() {
return resolvedVirtualModuleId;
}
},
},
load(id) {
if (id === resolvedVirtualModuleId) {
load: {
filter: {
id: new RegExp(`^${resolvedVirtualModuleId}$`),
},
handler() {
if (entrypoint) {
return `\
import * as mod from ${JSON.stringify(entrypoint)};
Expand All @@ -80,7 +86,7 @@ export const setup = (Alpine) => {
}`;
}
return `export const setup = () => {};`;
}
},
},
};
}
Expand Down
Loading