Skip to content

Use aliases in NPM_FILE_PATTERNS to decrease nesting #24

@hwalinga

Description

@hwalinga

Usually you only need one file from a package. You can expose that single file using NPM_FILE_PATTERNS, but the nesting of folders can still be annoying.

For example, if I need jszip I will include:

NPM_STATIC_FILES_PREFIX = os.path.join('js', 'vendor')
NPM_FILE_PATTERNS = {"jszip": ["dist/jszip.min.js"]}

And now I get the file at 'static/js/vendor/jszip/dist/jszip.min.js'. The dist folder here is unneeded. In addition, I actually don't bother with the jszip directory, but want to have the file directly in the folder, as I am already nesting it using NPM_STATIC_FILES_PREFIX.

So, I just want to have the file in 'static/js/vendor/jszip.min.js'.

You might be able to allow for configuration by having the NPM_FILE_PATTERNS as a tuple with ("source", "destination").

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