Skip to content

How can a plugin add additional files to the build? #45

@dominicbarnes

Description

@dominicbarnes

I'm working on a plugin that creates an image sprite out of a series of image files. In the old version of component, I accomplished this in a really hacky way that I'd like to avoid.

When I say "hacky", I mean I had to do 2 things. First, I generated the relevant CSS and injected it via builder.addFile. Then, I generated the image in a temp directory, then copied it to where it "should" be. (ie: calculated the destination based on what are likely internal APIs/properties)

Right now, my component.json files look like: (I'm open to changing this to make things easier)

{
    "name": "something",
    "sprite": [
        "images/*"
    ]
}

The end-result is a sprite.png and sprite.css that are added to this particular component's manifest. In this new builder, is there any way that a plugin can add/remove files in the build itself?

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