{"library":"parcel-resolver-elm-bundle","title":"Parcel Elm Bundle Resolver","description":"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.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install parcel-resolver-elm-bundle"],"cli":null},"imports":["import { Elm } from 'elm-bundle:widget-a';","import type { Elm } from 'elm-bundle:widget-a';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"{\n  \"extends\": \"@parcel/config-default\",\n  \"resolvers\": [\"parcel-resolver-elm-bundle\", \"...\"]\n}\n\n// package.json\n{\n  \"name\": \"my-elm-app\",\n  \"version\": \"1.0.0\",\n  \"description\": \"My Elm application bundled with Parcel\",\n  \"main\": \"index.js\",\n  \"source\": \"index.html\",\n  \"scripts\": {\n    \"start\": \"parcel\",\n    \"build\": \"parcel build\"\n  },\n  \"elm-bundle\": {\n    \"widget-a\": [\n      \"./src/Main.elm\",\n      \"./src/MainB.elm\",\n      \"./src/MainC.elm\"\n    ]\n  },\n  \"devDependencies\": {\n    \"parcel\": \"^2.6.2\",\n    \"parcel-resolver-elm-bundle\": \"^1.0.0\"\n  },\n  \"peerDependencies\": {\n    \"elm\": \"^0.19.1-5\"\n  }\n}\n\n// src/index.js\nimport { Elm } from 'elm-bundle:widget-a';\n\nconst app = Elm.Main.init({\n  node: document.getElementById('elm-app')\n});\n\n// Example: Interact with Elm ports (if defined in Main.elm)\n// app.ports.fromElm.subscribe(message => {\n//   console.log('Received from Elm:', message);\n// });\n\n// app.ports.toElm.send('Hello from JavaScript!');\n","lang":"javascript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}