Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Add a template tag that interfaces with Bowers main directive #9

Description

@gaqzi

One thing I noticed with jQuery switching the path to where the main file is located is that currently things are kind of brittle.

If a library changes the location you've to go in and change the includes to get it working again.

So I suggest a tag working like this:

{% bower 'packagename' 'fallback-path-if-no-main' %}
Ex:
{% bower 'jquery' 'jquery/dist/jquery.js' %}

The main field in Bower can be a string or an array, so I would suggest that in case the main is an array the tag would pick the first item in the list. If passed in argument is packagename/file.js it'll look for that file in the array and output the path to the file. If main is just a string the filename after the slash will be matched against that file and if it doesn't match an error will be raised.

To get a listing of all the files do: bower list --paths

If you agree with this I'll implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions