Closed temosis closed 5 years ago
Sounds like a great feature, I'll let you know when it's added.
Hey @temosis, I've just released v1.2.0 which adds this option.
Here's how you can now disable injection:
const mix = require('laravel-mix');
require('laravel-mix-twig-to-html');
const files = [
{
template: 'src/templates/about/**/*.twig',
title: 'About',
inject: false, // disable asset tag injection
},
{
template: 'src/templates/index.twig',
title: 'Home',
inject: false, // disable asset tag injection
}
]
mix.twigToHtml({
files: files,
fileBase: 'src/templates',
});
Looks like this option is enabled by default for the new globs option. Can we disable by default and enable on a per file config as noted above? Maybe a fileOptions
for global globs?
{
files: 'src/templates/**/*.{twig,html}',
fileOptions: {
inject: false,
},
fileBase: 'src/templates',
twigOptions: { data: {} },
}
Add Option to disabled injection for HtmlWebpackPlugin