Skip to content

Feature proposal: @import (plugin) "myplugin.js" (or @plugin "myplugin.js") #2416

Closed

Description

@matthew-dean

Surfacing this here as proposed by @rjgotten in #1861. "Plugins" were marked as implemented per that discussion, with anything not included in the plugin commit being deferred to a separate thread, so putting this proposal made during the discussion for housekeeping / any further discussion.

From @rjgotten:


Just to change things up; how about a declarative syntax to load "user mode" plugins from LESS style sheets themselves. Something like:

@import (plugin) "../plugins/my-plugin.js";

That would certainly open up possibilities for more heavy duty styling 'frameworks' without requiring customizing your installation with additional packages via npm, etc.

...The absolute easiest and most foolproof way to ensure a plugin is loaded is by picking it up as an import as part of the compilation process. Completely hands-off, no user-configuration required.

Other comments:

@calvinjuarez commented on Feb 26, 2014

As a non-lessc, pre-processor-style, CodeKit LESS user, I'm very in favor of a directive in the LESS file itself. I'd prefer to have a separate directive keyword (like, say @plugin), because I feel like the function of a plugin (augmenting how LESS works) is different to imports (affecting the output CSS). That's my 2¢.

Activity

  1. rjgotten commented on Feb 25, 2015

    @rjgotten
    Contributor

    @matthew-dean
    I have a proof of concept of the @import (plugin) "../plugins/my-plugin.js"; syntax working on the NodeJS side of things.

    Fasted way to hammer it out was to place a hard require() call inside the ImportManager class, which works well enough. Ofcourse I really should set this up to work in an environment agnostic way. I have some ideas regarding how to set this up, but will have to see if they pan out.

    Would you be interested in the work I've done sofar?

  2. seven-phases-max commented on Mar 30, 2015

    @seven-phases-max
    Member

    Should not we close this since #2479? (There're some additional stuff to be implemented further like passing options to plugin and cli/@plugin interfaces unification, but I guess these are to be further feature-requests/issues to be ticked...)

  3. rjgotten commented on Mar 30, 2015

    @rjgotten
    Contributor

    @seven-phases-max
    Should not we close this since #2479?

    I still have the #2522 pull request open. It fixes several scoping issues and provides more complete coverage in the unit test suite.

  4. lukeapage commented on Mar 30, 2015

    @lukeapage
    Member
  5. matthew-dean commented on Oct 1, 2015

    @matthew-dean
    MemberAuthor

    Closing as #2479 and #2522 have been merged.

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

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