@tileflow/next
v0.1.0-alpha.8
Published
Next.js adapter for Tileflow map style development and static artifacts.
Maintainers
Readme
@tileflow/next
Next.js adapter for local Tileflow style development and static build artifacts.
// next.config.ts
import {withTileflow} from '@tileflow/next';
import type {NextConfig} from 'next';
const nextConfig: NextConfig = {};
export default withTileflow(nextConfig);Add a catch-all App Router handler so next dev can serve fresh local styles from
tileflow.config.ts. withTileflow() rewrites /tileflow/* to this internal route only during
development; production uses the static files written to public/tileflow.
// app/api/tileflow/[[...tileflow]]/route.ts
import {createTileflowRouteHandlers} from '@tileflow/next/server';
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
export const {GET, HEAD} = createTileflowRouteHandlers({
routeBase: '/api/tileflow',
});During next build, withTileflow() writes static artifacts to
public/tileflow. During development, the route handler serves the same manifest,
styles, and icon sprites without a separate tileflow dev process.
Docs: https://tileflow.dev/docs
