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

mimosa-requirebuild-automodule

v0.1.4

Published

Mimosa module that infer's r.js module configs and includes assets.

Downloads

8

Readme

mimosa-requirebuild-automodule

This is a Mimosa module. The goal is to streamline the process of building a site with multiple minimized and optimized r.js modules. This is useful for larger sites where you may have some primary application code, and additional assets that can be loaded after the application has been started.

More detailed documentation is needed (coming soon), but here is a quick overview.

By default (without any configuration changes), this module augments your r.js config (in the mimosa config) to build an optimized module for each directory directly under your source javascript directory. It does this by searching for any javascript assets and adding them to individual module configs, as well as adding entries for any html assets it finds (aliased to be loaded using the require text plugin).

There are a number of things that you can do by customizing the config a bit. The documentation (and some examples) for these features are coming soon. For now, here is a quick overview:

  • Specify different patterns for matching files for inclusion (defaults to match .js files)
  • Specify exclude strings or regexs to exclude files
  • Specify modules to not be built into optimized files
  • Specify plugin configuration for files to be loaded using require plugins (by default is configured to use the text plugin for html files)
  • Specify that a given module should include all the assets of another module
  • Specify that a given module is actually a version of another module (see description below), and should include the other modules assets, but all of its require statements should be aliased to match the original module

The version of feature is the primary goal of this module. The other features were necessary to support this goal cleanly. This arose from the need to support multiple versions of the same site. Specifically, this means different versions for different brands, and also for different device types (mobile vs desktop). The feature allows you to specify that a given module builds on top of another module, overriding any matched resources. That is to say that if moduleB is a versionOf moduleA, it will include all of moduleA's resources as well as all of its own resources, replacing those of moduleA where appropriate.

This is difficult to explain and comprehend from a text description, and an example of all these features is hopefully coming soon (as I get time).