Skip to content

Modules & CSS #1

@backspaces

Description

@backspaces

Great idea! Two things I need are use of es6 modules and css wrapped in self executing modules (no exports)

First of all, I need a module for uPlot-lazy-interface, I work on a repo which is all es6 Modules based. uPlot has one, probably a rollup? It would import uPlot.js. It would also import the css:

Secondly, I don't want to force my users to deal with the uPlot css. I'd wrap the css in a module that is used only for it's side effects, i.e. has no exports. Looks like this:

document.head.innerHTML += `
<style>
${css}
</style>`

The point of both is to place dependencies within the JavaScript using them! Placing them globally results in many repos that have un-used resources, both JS and CSS. Es6 modules eliminate them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions