Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Parsing .mustache file as .html #84

Open
drypatrick opened this issue Feb 8, 2021 · 1 comment
Open

[enhancement] Parsing .mustache file as .html #84

drypatrick opened this issue Feb 8, 2021 · 1 comment

Comments

@drypatrick
Copy link

Hi, and thanks for this wonderful plugin.
I would like to ask if would be possible to extend the minify functionality to the .mustache file, since they have the same feature of a standard html file.
Just saving with .html extension lets the plugin do it's job, but it's pretty boring to changhe the extension each time.

Thanks, bye!

@kendfss
Copy link

kendfss commented Nov 18, 2021

There's a few ways to do this. Perhaps the easiest is to change

    "allowed_file_types": [
        "css",
        "js",
        "json",
        "html",
        "svg"
    ],

into:

    "allowed_file_types": {
        "html": [".mustace"],
        "js": ["js", "ts"],
        // etc
    }

But this would mean changing the semantics of allowed_file_types to be applicable outside the context of acting on saves

Another way is to implement via #89
The easy(?) way to do this is by allowing:

"aliases": [".this", "that", "and", "the", ".other"]

as an option for each extension

Another way of doing that would be to simply add a new extension with the following option:

"mustache": {
  "syntax": "html"
}

This would allow you to get more specific with how you want to handle this extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants