You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
For Treeherder, we have a multi-page app that needs to use different custom templates for each page, rather than the stock template generated by html-webpack-plugin / html-webpack-template.
At the same time as upgrading to Neutrino v6, this has been reduced down to roughly:
(neutrino)=>{// Remove the default entry point and html pluginneutrino.config.entry('index').delete(neutrino.options.entry);neutrino.config.plugins.delete('html');constentries=['index','perf','logviewer','failureviewer','userguide'];entries.forEach(entry=>neutrino.config.entry(entry).add(join(neutrino.options.source,`entry-${entry}.js`)).end().plugin(`html-${entry}`).use(HtmlPlugin,[{filename: `${entry}.html`,template: join(neutrino.options.source,`${entry}.html`),// The vendor/runtime chunk names here must match those in neutrino-middleware-chunk.chunks: [entry,'vendor','runtime'],// Copied from neutrino-middleware-html-templateminify: {useShortDoctype: true,keepClosingSlash: true,collapseWhitespace: true,preserveLineBreaks: true},}]));},
Whilst this is an improvement on how it was before, it still has to duplicate the minify options from neutrino-middleware-html-template.
Ideally I'd be able to just .use() the middleware multiple times (passing the options I need to override for each), and be able to override the plugin entry name for each, to avoid the html name collision.
Is there a way to do this that I'm missing or else would adding support for customising the names be possible?
The text was updated successfully, but these errors were encountered:
There is not currently a way to do this, but this is something I've thought about before. I think the best solution would be to probably allow middleware to accept through its options what its name or ID should be, e.g.:
I also think this should be managed at the middleware level, since some middleware can generate many pieces of identifiable configuration, and it's possible you may want to allow configuring multiple names via middleware options:
For Treeherder, we have a multi-page app that needs to use different custom templates for each page, rather than the stock template generated by html-webpack-plugin / html-webpack-template.
In our Neutrino v4 config there's a lot of unnecessary duplication:
https://github.com/mozilla/treeherder/blob/5c0c7eb5e241638bc1d636cce2468d568e374ce2/neutrino-custom/base.js#L96-L145
At the same time as upgrading to Neutrino v6, this has been reduced down to roughly:
Whilst this is an improvement on how it was before, it still has to duplicate the minify options from neutrino-middleware-html-template.
Ideally I'd be able to just
.use()
the middleware multiple times (passing the options I need to override for each), and be able to override the plugin entry name for each, to avoid thehtml
name collision.Is there a way to do this that I'm missing or else would adding support for customising the names be possible?
The text was updated successfully, but these errors were encountered: