Mowdown is a lightweight, standalone JavaScript bundler designed for straightforward production preparation of web applications. Currently at version 2.2.2, it provides a minimal approach to consolidating and optimizing HTML, CSS, and JavaScript assets without requiring complex build configurations or a persistent local server process. The tool operates by scanning specified HTML files, identifying local CSS and JavaScript references (via `<link>` and `<script>` tags), and then concatenating, minifying, and optionally applying Babel transformations to these assets. Its primary differentiator is its simplicity and "no build step" philosophy, aiming to reduce developer overhead by working directly with existing HTML structures rather than introducing module systems or advanced optimizations like tree shaking or code splitting. It is suitable for projects where the build process needs to be minimal and predictable, especially for static sites or simple web applications. It operates purely as a Node.js utility.
npm install mowdownVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `mowdown` to bundle and minify HTML, CSS, and JavaScript files from a source directory into an output directory. It creates temporary input files and a minimal `.babelrc` (which mowdown requires), then processes them and cleans up, showcasing basic API usage with options like `sourceFolder` and `isOverwritingHtml`.
For any CDN-hosted CSS links, include their full URLs in both the `excludeCss` and `prependCssUrls` arrays within the options object passed to the `mowdown` function.
Create a `.babelrc` file in your project root. A minimal configuration like `{ "presets": ["@babel/preset-env"] }` is often sufficient, or you can copy the example from the mowdown repository if you need more specific Babel functionality.Always specify a separate `outputFolder` that is distinct from your source HTML files' location, or explicitly set `isOverwritingHtml: false` in the options object passed to the `mowdown` function to ensure original files are preserved.
Ensure a `.babelrc` file exists in your project's root directory. Even a basic configuration like `{ "presets": ["@babel/preset-env"] }` is required. Verify that necessary Babel packages are available in mowdown's internal dependencies or your project's `node_modules` if you're running locally.Double-check the paths specified in your HTML `<script src="...">` and `<link href="...">` tags. If your assets are not in the same directory as your HTML files, ensure the `sourceFolder` option is correctly pointing to the directory containing all your asset files.
Provide a dedicated `outputFolder` that is different from your `sourceFolder` to receive the bundled output, or explicitly set `isOverwritingHtml: false` within the options object passed to the `mowdown` function to prevent source file modification.
No dependency data recorded yet.