_default.page.*

The _default.page.* files allow us to define hooks and settings that apply to all pages.

For example, we can define the render() hook in _default.page.server.js in order to define how our pages are rendered to HTML.

_default.page.route.js

The _default.page.route.js can export special global hooks that allow us to control the routing process, see _default.page.route.js.

Multiple defaults

There can be several _default.{server|client}.js files:

marketing/renderer/_default.page.server.js
marketing/renderer/_default.page.client.js
marketing/pages/index.page.js
marketing/pages/about.page.js
marketing/pages/jobs.page.js
admin-panel/renderer/_default.page.server.js
admin-panel/renderer/_default.page.client.js
admin-panel/pages/index.page.js

The marketing/_default.page.* files apply as default to the marketing/**/*.page.js files, while the admin-panel/_default.page.* files apply as default to the admin-panel/**/*.page.js files.