Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset injection #2

Closed
temosis opened this issue Aug 14, 2019 · 3 comments
Closed

Asset injection #2

temosis opened this issue Aug 14, 2019 · 3 comments

Comments

@temosis
Copy link

temosis commented Aug 14, 2019

Add Option to disabled injection for HtmlWebpackPlugin

@ben-rogerson
Copy link
Owner

Sounds like a great feature, I'll let you know when it's added.

@ben-rogerson
Copy link
Owner

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',
});

@ryanscherler
Copy link

ryanscherler commented Aug 15, 2019

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: {} },
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants