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-require-library-package

v0.5.1

Published

A library packaging module for Mimosa

Downloads

6

Readme

mimosa-require-library-package

Overview

Use this module with Mimosa to package library code built using AMD/RequireJS into a single file for use in other applications. This module, when used in tandem with the mimosa-require module will package up several versions of your library for distribution and use outside of your library project.

For more information regarding Mimosa, see http://mimosa.io

Usage

Add 'require-library-package' to your list of modules AFTER the require module. That's all! Mimosa will install the module for you when you start up.

Functionality

By default this module will create three versions of your library.

  1. One with the Almond AMD shim and a wrapper that allows for exporting your library as a global property to be used in containing apps.
  2. One for use in other RequireJS applications, **but not containing libraries specified in the removeDependencies array ** - for instance JQuery or Backbone.
  3. One for use in other RequireJS applications but containing all of the dependent libraries and code.

This module executes during a mimosa build when both the --optimize and --package flags are used.

Default Config

libraryPackage:
  packaging:
    shimmedWithDependencies:true
    noShimNoDependencies:true
    noShimWithDependencies:true
  overrides:
    shimmedWithDependencies: {}
    noShimNoDependencies: {}
    noShimWithDependencies: {}
  outFolder: "build"
  cleanOutFolder: true
  globalName: null
  name:null
  main:null
  mainConfigFile: null
  removeDependencies: []
  • packaging - provides three options for packaging your library. By default all are enabled. Each option will deliver the compiled asset to a folder named for the packaging type.
  • packaging.shimmedWithDependencies - when set to true a fully batteries included version of your library is generated. Includes an AMD shim (Almond) and all dependencies.
  • packaging.noShimNoDependencies - when set to true an optimized file is created with shim and dependencies excluded.
  • packaging.noShimWithDependencies - when set to true an optimized file is created without a shim but including dependencies.
  • overrides - Properties passed the overrides objects are passed straight to the r.js optimizer for the given packaging type. Any settings in overrides will overwrite all other settings, including, for instance, the name property.
  • outFolder - the name of the folder, relative to the root of the project, to place the packaged output.
  • cleanOutFolder - when or not to clean the outFolder as part of a build
  • globalName - Required if shimmedWithDependencies is set to true. The global name of the library for use in non module-managed situations. i.e. "$" or "Backbone"
  • name - Name of library. Ex: "jquery.foo.js". This will be used as the output file name for the optimization. Required.
  • main - The AMD path to the root/entry point of your library.
  • mainConfigFile - A string, the location of the requirejs configuration. Relative to the watch.compiledDir directory. By default, if require.commonConfig (from the mimosa-require module) is used and exists, this is set to that file. If mainConfigFile is not provided, and require.commonConfig does not exist, this is set to the main file.
  • removeDependencies - A list of AMD paths to dependencies to exclude from the library. For instance, "jquery" or "vendor/openlayers". Libraries you expect users of the library to include themselves.