This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support per-page HTML template customisation via 'mains' (#1029)
This adds support for defining each entry point in `mains` as an object, where the path to the entry point is now defined under an `entry` property, and any other properties can be used by presets for page-specific options. (The short form using a string is still supported.) In the case of `@neutrinojs/web` (and presets that inherit from it), these additional properties are then used to override the options passed to `html-webpack-plugin`, allowing for page-specific customisation of the generated HTML template. For example: ``` module.exports = { options: { mains: { index: { entry: './index', // Options here take priority over the preset's `html` options below. title: 'Site Homepage', }, admin: { entry: './admin', title: 'Admin Dashboard', }, account: { entry: './user', inject: true, template: './my-custom-template.html', }, } }, use: ['@neutrinojs/web', { // Customise the defaults used for all pages. html: { minify: false, } }] } ``` For a list of the available `html-webpack-plugin` options, see: https://github.com/jantimon/html-webpack-plugin#options Fixes #865.
- Loading branch information
Showing
13 changed files
with
226 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.