Skip to content

Conversation

@scrhartley
Copy link
Contributor

@scrhartley scrhartley commented Nov 4, 2025

Description

Allow running the build commands on Windows.

On Windows, even under WSL, it can't find sed from within the package.json scripts.
In addition, Windows doesn't have glob expansion, so instead it needs to get brotli-cli to do it.

Due to line ending differences, the brotli versions of the non-minified JS files don't match exactly when generated on Windows. (Minification seems to auto-convert Windows line endings to Linux ones, but the brotlification doesn't.) I tried playing about with Git auto eol conversation config, but I didn't manage to win that battle.

Testing

I wiped out the contents of the dist folder, ran npm run build and then looked at the git diffs to see what changed.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@MichaelWest22 MichaelWest22 added the htmx 4 Issues specific to htmx version 4 label Nov 19, 2025
@scrhartley scrhartley marked this pull request as draft November 21, 2025 18:35
@scrhartley
Copy link
Contributor Author

Update: it seems that the reason that it wasn't working in WSL is due to Windows interop, meaning it was picking up the Windows version of npm. After running sudo apt install npm the correct npm was used.

@scrhartley
Copy link
Contributor Author

With WSL, for a Windows checkout, in addition to the issue with line endings for brotli non-minified JS files, there is also a problem where the esm js will use Linux line endings for export default htmx even though rest of the file is using Windows line endings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

htmx 4 Issues specific to htmx version 4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants