full site update
This commit is contained in:
26
node_modules/astro/dist/actions/integration.js
generated
vendored
26
node_modules/astro/dist/actions/integration.js
generated
vendored
@@ -1,32 +1,30 @@
|
||||
import { ActionsWithoutServerOutputError } from "../core/errors/errors-data.js";
|
||||
import { AstroError } from "../core/errors/errors.js";
|
||||
import { isServerLikeOutput, viteID } from "../core/util.js";
|
||||
import { ACTIONS_TYPES_FILE, VIRTUAL_MODULE_ID } from "./consts.js";
|
||||
import { ActionsWithoutServerOutputError } from "../core/errors/errors-data.js";
|
||||
import { viteID } from "../core/util.js";
|
||||
import { ACTION_RPC_ROUTE_PATTERN, ACTIONS_TYPES_FILE, VIRTUAL_MODULE_ID } from "./consts.js";
|
||||
function astroIntegrationActionsRouteHandler({
|
||||
settings
|
||||
settings,
|
||||
filename
|
||||
}) {
|
||||
return {
|
||||
name: VIRTUAL_MODULE_ID,
|
||||
hooks: {
|
||||
async "astro:config:setup"(params) {
|
||||
params.injectRoute({
|
||||
pattern: "/_actions/[...path]",
|
||||
async "astro:config:setup"() {
|
||||
settings.injectedRoutes.push({
|
||||
pattern: ACTION_RPC_ROUTE_PATTERN,
|
||||
entrypoint: "astro/actions/runtime/route.js",
|
||||
prerender: false
|
||||
});
|
||||
params.addMiddleware({
|
||||
entrypoint: "astro/actions/runtime/middleware.js",
|
||||
order: "post"
|
||||
prerender: false,
|
||||
origin: "internal"
|
||||
});
|
||||
},
|
||||
"astro:config:done": async (params) => {
|
||||
if (!isServerLikeOutput(params.config)) {
|
||||
if (params.buildOutput === "static") {
|
||||
const error = new AstroError(ActionsWithoutServerOutputError);
|
||||
error.stack = void 0;
|
||||
throw error;
|
||||
}
|
||||
const stringifiedActionsImport = JSON.stringify(
|
||||
viteID(new URL("./actions", params.config.srcDir))
|
||||
viteID(new URL(`./${filename}`, params.config.srcDir))
|
||||
);
|
||||
settings.injectedTypes.push({
|
||||
filename: ACTIONS_TYPES_FILE,
|
||||
|
Reference in New Issue
Block a user