npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

snowpack-plugin-elm-optimize-level-2

v1.0.0

Published

An Elm plugin for Snowpack with HMR using elm-optimize-level-2 for production builds

Readme

Notes about this fork

This is a fork of https://github.com/marc136/snowpack-plugin-elm

This has an alteration from the original snowpack-plugin-elm in that it uses elm-optimize-level-2 for production builds over the default Elm compiler optimizations.

Record optimization is turned on by default. This option is not configurable at the moment. Open an issue if you'd like for this to be configurable.

Snowpack Elm Plugin (Fork)

This plugin adds support for the Elm language to any Snowpack project.
With it, you can import *.elm files and have them compile to JavaScript modules including Hot Module Replacement (HMR).

Usage

Have a look at the example folder. The interesting bits are the snowpack configuration and how to import an Elm app in a .js file or in a .html file.

But in general, you will be able to import it like this:

// Both default and named import is supported
import Elm from './Main.elm';
// import { Elm } from './Main.elm';

Elm.Main.init({
  //...
});

Getting started

If this is your first time using Snowpack, please follow their tutorial. Or you can just start with npx snowpack init.

Install snowpack-plugin-elm, for instance with npm install --save-dev snowpack-plugin-elm or another node.js package manager.

Then add the plugin to your Snowpack config, e.g. in snowpack.config.json, either in the simplest way

{
  ...
  "plugins": [
    "snowpack-plugin-elm"
  ],
}

or with plugin options

{
  ...
  "plugins": [
    [ "snowpack-plugin-elm", { "debugger": "dev", "optimize": "build" } ]
  ],
}

Then you can import your Elm code inside a .html or .js file

import Elm from './Main.elm';
Elm.Main.init({
  node: document.body,
  flags: {},
});

Plugin options

Default values:

{
  "verbose": false,
  // When to enable Elm's time-traveling debugger
  "debugger": "dev", // One of "never", "dev" (only on `snowpack dev`) or "always"
  "optimize": "build", // One of "never", "build" (only on `snowpack build`) or "always"
  "root": "", // same as the `root` folder of the snowpack config
}

Note: The Elm debugger needs information that is stripped away when using optimize, so a setting like { "debugger": "always", "optimize": "build" } would fail and is rejected by the plugin.
If you want to e.g. have a build with an enabled debugger, you need to use { "debugger": "always", "optimize": "never" }.

Development

First, clone this repository.

Tests

Execute npm test to start the integration tests and follow the plugin behavior with the test suite.

For more information, set the verbose variable to true.

To use it on another project

As described in this Snowpack guide:

  1. Clone this repo and cd into it.

  2. Run npm link to expose the plugin globally (in regard to your development machine).

  3. Create a new, example Snowpack project in a different location for testing

  4. In your example Snowpack project, run npm install && npm link snowpack-plugin-elm.

    • Be aware that npm install will remove your linked plugin, so on any install, you will need to redo the npm link snowpack-plugin-elm.
    • (The alternative would be to use npm install --save-dev <folder_to_this_repo>, which would create the "symlink-like" entry in your example Snowpack project’s package.json)
  5. In your example Snowpack project, add snowpack-plugin-elm to the snowpack.config.json along with any plugin options you’d like to test.