Skip to content

CSS version number (prevent caching) #97

@badlydrawnrob

Description

@badlydrawnrob

This will make sure css is not cached in the browser ...
Running this with time npm run build in terminal takes 3.95s (1s more than without it)

Works

You've got to both wrap in quotes " ", and escape them \" ...

--variable-json css-version=\"$(npm pkg get version)\"

Does not work

-- Pandoc and get npm version number
--variable-json css-version=$(npm pkg get version)
-- For some reason this fails
--variable-json css-version=$npm_package_version

npm pkg get version returns a "string" value though, and we'd need a non-string value for our ?=version number or else we'll get an unexpected " " error.

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