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 🙏

© 2024 – Pkg Stats / Ryan Hefner

elixirscript-brunch

v0.3.0

Published

Adds ElixirScript support to brunch.

Downloads

7

Readme

ElixirScript Brunch Plugin

This plugin for brunch adds support for ElixirScript files.

It will look for files with the extensions ex, exs, or exjs in your watched paths

It depends on the elixirscript binary being in your path. For more information check here: elixirscript

elixirscript-brunch relies on the following options:

plugins: {
  ...
  elixirscript: {
    inputFolder: "web/static/exjs",
    outputFolder: "web/static/js",
    mainModule: "MyApp",
    convertToES5: false
  }
}

inputFolder (required): This is the folder that your elixirscript code is located

outputFolder (required): This is the folder that the output will end up in.

mainModule (required): The name of starting, or main, module in your elixirscript code. i.e. if your main module is:

defmodule MyApp do
  ...
end

then MyApp is the name to use here. elixirscript-brunch uses rollup to bundle the translated code together. Elixirscript's output names files with the module name. The output will be the name of the main module. In this case the output will be named "MyApp.js"

convertToES5 (optional, defaults to false): Whether or not to transpile output to ES5 using babel and the //es2015 preset

Usage with Phoenix: This is just an example of how you could use this plugin with Phoenix

  1. Install the elixirscript-brunch plugin:
npm install --save elixirscript-brunch

Note: In your package.json file, be sure to place it above any of your other Brunch plugins. The reason for this is that Brunch runs plugins in the order that they appear in the package.json file.

  1. Configure the elixirscript-brunch plugin as described above. Using the above settings, your elixirscript code will be in the web/static/exjs folder and a file called MyApp.js will end up in your web/static/js folder. Since we made sure in our previous step this plugin runs before the others MyApp.js will be picked up by the remaining plugins in the pipeline for javascript. You can change this by updating the configuration if, for instance you would prefer not to output the file in to the web/static/js folder.