Skip to content

Allow to conditionally inline ressources #25

Open
@AndyOGo

Description

This plugin is great.

I would like to utilize some more options of posthtml-inline-assets to inline only certain resources.

My use case is that I need to inline CSS for a splash screen or above the fold content only.

Proposal

  • Either allow to configure filters e.g. with resolve option
  • Or use a declarative approach at the HTML node, e.g. with a data-inline boolean attribute
    <--! will be inlined -->
    <link rel="stylesheet" href="./foo.css" data-inline />
    <script src="./foo.js" data-inline></script>
    <--! will not be inlined -->
    <link rel="stylesheet" href="./bar.css" />
    <script src="./bar.js"></script>

Alternatively if it would work the same as in Parcel V2, that would be great too.
https://parceljs.org/languages/html/#inline-script-and-style-tags

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions