parcel-resolver-elm-bundle is a Parcel resolver designed to streamline the compilation and bundling of multiple Elm source files into a single JavaScript output. It simplifies the process that would otherwise require manually listing all Elm entry points for `elm make`. The package is currently at version 1.0.2, indicating a stable, actively maintained release. While release cadence isn't explicitly stated, its integration with Parcel's resolver system suggests updates would align with major Parcel releases or significant Elm compiler changes. Its key differentiator is the custom `elm-bundle:` import syntax, allowing developers to define Elm bundles within their `package.json` and reference them abstractly, enhancing modularity and build system clarity for Elm projects within Parcel. This approach mimics the `elm make MainA.elm MainB.elm` command but integrates it directly into the JavaScript import graph, providing a seamless development experience for larger Elm applications.
npm install parcel-resolver-elm-bundleVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure Parcel to use the `elm-bundle` resolver via `.parcelrc`, define an Elm bundle named 'widget-a' in `package.json`, and then import the compiled bundle into a JavaScript entry point for initialization.
Ensure `parcel-resolver-elm-bundle` is listed before other generic resolvers (like `...`) in your `.parcelrc` resolvers array: `"resolvers": ["parcel-resolver-elm-bundle", "..."]`.
Upgrade Parcel to `^2.6.2` or higher to ensure compatibility with the resolver. Run `npm install parcel@latest` or `yarn add parcel@latest`.
Install Elm globally via `npm install -g elm` or as a dev dependency `npm install --save-dev elm`, ensuring it's accessible to your build environment.
Verify `parcel-resolver-elm-bundle` is in your `.parcelrc` before `...`, and ensure the `elm-bundle` section in `package.json` correctly defines `widget-a` with valid paths to Elm entry files.
Install Elm globally or locally: `npm install -g elm` or `npm install --save-dev elm` (if using `npx elm`). Ensure it's available in your system's PATH or `node_modules/.bin`.
Double-check all file paths within your `package.json` `elm-bundle` definitions. Paths must be relative to the `package.json` file itself.