Repository navigation
v4.0.0-0
Pre-release
Pre-release
The first prerelease of v4, for Vite 6, 7 and 8. Install it with npm i -D vite-plugin-elm@next elm.
Breaking changes
- Supports Vite 6, 7 and 8, and Node.js
^20.19.0 || >=22.12.0. Stay on v3 for Vite 5. - The plugin runs
elm makeby itself instead of through node-elm-compiler (#873). Installelmin your project, or have it inPATH. nodeElmCompilerOptionsis removed. Use the newpathToElmoption instead ofnodeElmCompilerOptions.pathToElm.- Compile errors are reported in the format of the Elm CLI. They keep colors in the terminal and point at the file and line on Vite's overlay.
- If you use elm-optimize-level-2 through
compiler, move topostprocessto keep static assets and?with=working.
See Migrating from v3.
New
pathToElm, and a lookup forelmfrom the closestnode_modules/.bin, thenPATH(#2)postprocessto transform the compiled code, e.g. with elm-optimize-level-2'stransform(#646, #878)/* @__PURE__ */annotations, which make the example's bundles about 40% smaller (#837, #875)- Tested with Elm 0.19.1, 0.19.2 and 0.19.3 (#877)
Fixes
- HMR works when the Vite root isn't the cwd. This was a hard error on Vite 8 (#806, #872).
- No deprecation warnings from Vite's Environment API, and
moduleType: 'js'for Rolldown (#872) - Passing something other than a string literal to
VitePluginHelper.assetshows an error on the overlay instead of crashing the dev server (#455, #874). - Asset tags are found in any quotes, and right after another tag (#878).
- The dev server compiles only the files that
server.fs.allowpermits (#879). - Imports in Elm block comments are no longer taken as dependencies (#873).
find-upis replaced with a smallelm.jsonlookup (#871).
Internal
- CI covers Node 20, 22, 24 and 26 on Linux, plus Windows and macOS.
- oxlint and oxfmt replace ESLint and Prettier (#876).