A simple integration to run solid-js with vite
Repo solidjs/solid-vite-plugin, read from GitHub 8 h ago. solidjs has not joined Take My Repo.
solid-js in jsdom tests even when they are reached only through another such package (fixes #543). They stayed external, so Node loaded a second solid-js for them, and components such as solid-transition-group's <Transition> rendered nothing.NODE_PATH when checking whether the project has @testing-library/jest-dom (fixes #541). pnpm's bin shims (pnpm vitest) point NODE_PATH at the hoisted virtual store, so in a workspace where any package depends on jest-dom the setup file was injected into projects without it, and Vitest failed with Cannot find module '<root>/@testing-library/jest-dom/vitest'. The check now walks node_modules up from the project root, as Vite does when it resolves setupFiles (backported from the next branch).ssr: true no longer builds the client environment first when its only input is one a server environment shares (inherited from the top-level build config). Hosts that set the client's real input after their server builds, such as Astro with a legacy adapter entry (virtual:astro:legacy-ssr-entry), keep their own build order instead of failing on a client build of the server entry.Frontend.hotUpdate gets theFrontendContext.hot tells compile that the transform serves a dev clientimport.meta.hot handling. ReactiveScript's .rx front end uses@solidjs/vite-plugin 3.0.0 is the stable Vite plugin for Solid 2.0 (solid-js, @solidjs/web and @solidjs/router 2.0.0). It replaces vite-plugin-solid. The README has a migration section.
@solidjs/compiler is the default. @solidjs/babel-plugin and @babel/core are optional peers.start: {}) gives SSR and client-only apps generated entries, streaming SSR in dev, a production { fetch } handler, an optional start.nodeServer, middleware, and a deployment contract for provider plugins such as Nitro and @cloudflare/vite-plugin.virtual:solid-env, dev diagnostics, performance tracks, and the optional @solidjs/start-devtools toolbar.?t= HMR timestamp (#540), and the SSR runner no longer serves stale code after an edit under workerd (#537).Peers: solid-js, @solidjs/web and @solidjs/babel-plugin at ^2.0.0.
The full list of changes is in CHANGELOG.md.
// @vitest-environment node when test.environment is jsdom or happy-dom. The ssr environment keeps the browser condition again, and only the conditions Vitest passes to Node leave it out, so msw/node still loads.configureServerErrors reach the toolbar, and the app's own hook is still called. The toolbar also gets the installed versions of solid-js, @solidjs/web, the plugin and Vite, and an endpoint that opens files in the editor.@babel/core and @solidjs/babel-plugin are now optional peer dependencies, and @types/babel__core is no longer a dependency, so a project on the default native compiler installs no Babel packages. Projects using compiler: 'babel' must install @babel/core and @solidjs/babel-plugin, and projects passing the babel option under the native compiler must install @babel/core; without them the plugin throws an error naming the option and the packages on the first transform. The babel option is now typed by the exported BabelOptions interface, which accepts Babel's TransformOptions without the plugin's declarations importing @babel/core.dist/client. With @cloudflare/vite-plugin 2.0, which writes the client to .cloudflare/output/..., it found nothing and baked in the development resolver, which returns source paths and no CSS. The server build now reads the manifest from the client environment's configured outDir first. A client build also no longer remembers lazy chunks from an earlier build by the same instance, so the client rebuild that Cloudflare runs after the worker writes the same files instead of a second copy of the app.start.nodeServer now precompresses the client build: the build writes a .br and a .gz beside each text file of 1 KiB or more, and dist/server/node.js serves the best one the request's Accept-Encoding allows, with Content-Encoding, the variant's Content-Length and Vary: Accept-Encoding. Rendered pages still stream uncompressed. nodeServer: { precompress: false } turns it off.dist/client/.vite/manifest.json from disk or fell back to the dev manifest (no client entry script or CSS on pages built for a provider that moves the output), and left .vite/manifest.json and .vite/solid-server-functions.json in the published client output. The plugins from solidPlugin() and the standalone serverFunctions() now set sharedDuringBuild, so Vite reuses one instance of them across environment builds, as sharedPlugins: true would.