Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to use esbuild with css import assertions/attributes #3384

@jogibear9988

Description

@jogibear9988

I've code where some librarys import css without a assertion or a with attribute:

   import aaSheet from "aa.css";

this works, but if I have this code:

  import bbSheet from "bb.css" assert {type: 'css'};

or this:

 import bbSheet from "bb.css" with {type: 'css'};

then the type of bbSheet hast to be a CSSStyleSheet, but esbuild does not create one.
And I don't know in the onResolveCallback if the "assert" or "with" attribute is present (the assert keyword was changed to with, but it should be nearly the same), so I don't know how I could create a plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions