Skip to content

The type attribute of the appended tag could be configurable #315

@Nouzbe

Description

@Nouzbe

Do you want to request a feature or report a bug?

Request a feature

What is the current behavior?
The attributes of the style or link tag that is appended to the DOM are configurable thanks to the attrs options, except for type which is always set to "text/css"

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
The type could be configurable just like all other attributes.

If this is a feature request, what is motivation or use case for changing the behavior?
Projects using less in browser need style elements with the type text/less to be appended to the DOM.

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
This could be a 4 lines change. I believe that replacing:

options.attrs.type = "text/css";

with

if(options.attrs.type === undefined) {
  options.attrs.type = "text/css";
}

in addStyles.js#L204 and addStyles.js#L215 would do the job.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions