github withastro/astro @astrojs/underscore-redirects@0.6.0

latest releases: astro@5.1.5, @astrojs/mdx@4.0.5, @astrojs/markdoc@0.12.5...
one day ago

Minor Changes

  • #12924 3caa337 Thanks @florian-lefebvre! - Updates how the output is determined in createRedirectsFromAstroRoutes. Since v0.5.0, the output would use the buildOutput property and config.output as a fallback. It no longer uses this fallback.

  • #12924 3caa337 Thanks @florian-lefebvre! - Updates the input requirements of createRedirectsFromAstroRoutes:

    • routeToDynamicTargetMap keys are IntegrationResolvedRoute instead of IntegrationRouteData (obtained from the astro:routes:resolved hook)
    • There's a new assets property, that can be obtained from the astro:build:done hook
    function myIntegration() {
      let routes;
      let buildOutput;
      let config;
    
      return {
        name: 'my-integration',
        hooks: {
          'astro:routes:resolved': (params) => {
            routes = params.routes;
          },
          'astro:config:done': (params) => {
            buildOutput = params.buildOutput;
            config = params.config;
          },
          'astro:build:done': (params) => {
            const redirects = createRedirectsFromAstroRoutes({
              config,
              buildOutput,
              routeToDynamicTargetMap: new Map(routes.map((route) => [route, ''])),
              dir: params.dir,
              assets: params.assets,
            });
          },
        },
      };
    }

Don't miss a new astro release

NewReleases is sending notifications on new releases.