2

Suppose we have the following routes defined:

const routes: Routes = [
  {
    path: '',
    component: WelcomeComponent
  },  
  {
    path: 'start',
    component: StartComponent
  }

Is the a way to tell Scully to skip generation fo a static page for the start route?

Ole
  • 41,793
  • 59
  • 191
  • 359
  • 1
    I’m sure this is possible.. don’t exactly know how, but I recommend asking this question in the scully gitter: https://gitter.im/scullyio/community – MikeOne Dec 29 '20 at 13:26

2 Answers2

5

You can do this by using the ignoredRoutePlugin.

`/someRoute`:{
  type:'ignored'
}

It doesn't look like it's in the documentation yet but here is the code in the repo: https://github.com/scullyio/scully/blob/main/libs/scully/src/lib/routerPlugins/ignoredRoutePlugin.ts

Brad Mc
  • 90
  • 5
3

In order to use a "wilcard"-ignore, you can use a routeProcessPlugin, declared in ./scully/plugins/plugin.ts:

import { HandledRoute, registerPlugin } from '@scullyio/scully';

registerPlugin(
  'routeProcess',
  'filteredRoute',
  (routes: HandledRoute[]): Promise<HandledRoute[]> => {
    return Promise.resolve(routes.filter((r) => !r.route.startsWith('/someRoute')));
  },
);

Make sure to import it in your scully.config.ts:

import { ScullyConfig } from '@scullyio/scully';
require('./scully/plugins/plugin');

export const config: ScullyConfig = {
  // your config here
}
AxeMaster
  • 31
  • 2