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

feat: add config to load JavaScript similar to CSS with Cache Busting #551

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ralphocdol
Copy link
Contributor

@ralphocdol ralphocdol commented Apr 2, 2025

See Issue #550

Configuration

Single files are prioritized for backwards compatibility and familiarity with the existing custom-css-file

document:
  custom-js-file: /assets/single.js # defer and async are not possible
  custom-js-files: 
    - src: /assets/sample1.js
    - src: /assets/sample2.js
      defer: true # if async is also true, it will take precedence

theme:
  custom-css-file: /assets/single.css
  custom-css-files:
    - /assets/sample1.css
    - /assets/sample2.css

outputs:

<link rel="stylesheet" href="/assets/single.css?v=1743689171">
<script src="/assets/single.js?v=1743689171"></script>

Multiple

document:
  custom-js-files: 
    - src: /assets/sample1.js
    - src: /assets/sample2.js
      defer: true

theme:
  custom-css-files:
    - /assets/sample1.css
    - /assets/sample2.css

outputs:

<link rel="stylesheet" href="/assets/sample1.css?v=1743689355">
<link rel="stylesheet" href="/assets/sample2.css?v=1743689355">
<script src="/assets/sample1.js?v=1743689355"></script>
<script src="/assets/sample2.js?v=1743689355" defer=""></script>

@ralphocdol ralphocdol changed the title feat: add config to load JavaScript similar to CSS feat: add config to load JavaScript similar to CSS with Cache Busting Apr 3, 2025
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

Successfully merging this pull request may close these issues.

1 participant