Overview of Snowpack built-in supported file types
.js, .mjs), TypeScript (.ts, .tsx), JSON (.json), JSX (.jsx, .tsx), CSS (.css), CSS Modules (.module.css), Images & Assets (.svg, .jpg, .png, etc.), and WASM (.wasm).website·Indexed 37 days ago
https://www.snowpack.dev/A build system for the modern web that leverages ESM. Features include Streaming Imports introduced in v3.0, Hot Module Replacement (HMR), and a plugin system to extend build behaviors. Documentation covers integration with React, Preact, Tailwind CSS, and testing frameworks like Jest and @web/test-runner.
.js, .mjs), TypeScript (.ts, .tsx), JSON (.json), JSX (.jsx, .tsx), CSS (.css), CSS Modules (.module.css), Images & Assets (.svg, .jpg, .png, etc.), and WASM (.wasm).Hot Module Replacement (HMR) allows Snowpack to push file updates to the browser without a full page refresh. Because Snowpack uses unbundled ESM, single file updates typically take 10-25ms.
Snowpack provides out-of-the-box HMR support for:
Fast Refresh is a framework-specific enhancement to HMR (supported for React, Preact, and Svelte) that preserves component state during updates, preventing resets of internal state (e.g., timer values or open popups) when a file is changed.
Snowpack is a frontend build tool designed as an alternative to complex bundlers like webpack or Parcel. It leverages the browser's native JavaScript module system (ESM) to provide instant startup (under 50ms), a 'build once, cache forever' approach, and HMR with Fast Refresh for React, Preact, and Svelte. It includes built-in support for JSX, TypeScript, React, Preact, and CSS Modules.
CRITICAL MAINTENANCE NOTE: As of April 20, 2022, Snowpack is no longer actively maintained and is not recommended for new projects. Recommended alternatives include Vite, esbuild, and Parcel.
Hot Module Replacement (HMR) allows Snowpack to push file updates to the browser without a full page refresh. Because Snowpack uses unbundled ESM, updates typically take 10-25ms.
Snowpack provides out-of-the-box HMR support for:
Fast Refresh is a framework-specific enhancement to HMR (supported for React, Preact, and Svelte) that preserves component state across updates, preventing internal state resets when a component is modified.
SNOWPACK_PUBLIC_ prefix. Any variable intended for use in the frontend web application must use this prefix to signal that it will be shared publicly..js, .mjs), TypeScript (.ts, .tsx), JSON (.json), JSX (.jsx, .tsx), CSS (.css), CSS Modules (.module.css), WASM (.wasm), and various image/asset formats (.svg, .jpg, .png, etc.).npm install. Snowpack fetches pre-built ESM versions of these packages from a CDN (like Skypack) behind the scenes and caches them locally for offline use. This is an opt-in feature; by default, Snowpack continues to use the local node_modules directory.// Standard import syntax; Snowpack handles the remote ESM fetch behind the scenes
import * as React from 'react';snowpack dev. The dev server automatically injects the necessary scripts into the browser, requiring no additional configuration for most users.import.meta.hot.accept() snippet to your entry file (typically src/index.jsx).ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root'),
);
// Hot Module Replacement (HMR)
if (import.meta.hot) {
import.meta.hot.accept();
}