Skip to content

Less plugin should share context with other loaded .less files #1

Description

@zkat

When loading files with the less plugin, it should make sure that compilation of those files groups all the .less files into a single compilation unit. The main reason for this is so already-@imported .less files get deduped and shared between all the less files that use them. There's a few details that go into this:

  • @import should be overridden (less has an API for overriding how URIs get resolved) so it resolves according to Steal pathing rules for importing modules.
  • Compilation will need to be delayed until the dependency tree is collected, and the final <style> tag should be injected into the page -before- any JavaScript executes (when using the client-side loader).
  • steal-tools should support spitting out a separate .css asset that includes the same as you'll see in the client.

As far as I've spoken with Justin, it's not clear SystemJS is able to delay execution like this right now, so we might have to do some patching on that as well. For reference, @shcarrico did this previously (or things like it) for both old-steal and for webpack. This has been tricky to implement correctly in both of those systems, so I don't really expect it to be a simple/easy task for new steal either, but it's a fairly important feature, imo. The need for it will become even more obvious once we have a bunch of standalone can.Components getting distributed.

See stealjs/steal#346 in reference to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions