Skip to content

Regex for path to css/js files #978

Answered by JuroOravec
KlimovArtem asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @grinchomsk, not currently. But that's an interesting idea! Would you look into it?

Just a lil correction, what you're thinking of are glob patterns.

I think to implement it, it should be enough to modify the contents of this if branch.

Instead of constructing a single filepath_abs like so:

filepath_abs = os.path.join(comp_dir_abs, filepath

We'd pass it first to glob() to expand any asterisks. Something like this:

filepath_abs_or_glob = os.path.join(comp_dir_abs, filepath)
matched_abs_filepaths = glob.glob(filepath_abs_or_glob)
for filepath_abs in matched_abs_filepaths:
    ...  # Rest of the original logic

We should also allow this only for the JS / CSS defined on the Media class, so …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KlimovArtem
Comment options

Answer selected by KlimovArtem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants