locomotivemtl / locomotive-boilerplate

🚂 Front-end boilerplate for projects by Locomotive.
https://locomotivemtl-boilerplate.vercel.app/
MIT License
455 stars 71 forks source link

Add asset versioning task #130

Closed mcaskill closed 1 year ago

mcaskill commented 1 year ago

A task to allow one to define zero or more JSON files and keys to create or update with the current timestamp.

By default, the boilerplate will maintain a version field in a 'assets.json' file which would be imported by a Web framework and applied to the URIs of compiled assets.

// ./loconfig.json
{
    "paths": {…},
    "tasks": {
        "scripts": […],
        "styles": […],
        "versions": [
            {
                "key": "assets_version",
                "outfile": "./config/config.json"
            }
        ]
    }
}
// ./config/config.json
{
    "assets_version": 1664988771399
    // …
}
cloudflare-pages[bot] commented 1 year ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 969b875
Status:⚡️  Build in progress...

View logs