mimosa-requirebuild-textplugin-include

Example Mimosa module for modifiying the r.js config pre-optimize

npm install mimosa-requirebuild-textplugin-include
1 downloads in the last day
64 downloads in the last week
233 downloads in the last month

mimosa-requirebuild-textplugin-include

Say that 3 times fast.

Overview

This is a Mimosa module. It both serves as a module to be used with Mimosa, and also serves as an example for how one would write a module to intercept the r.js configurations before optimization occurs.

The actual function of this module is to find text dependencies and include them in the include array for a r.js run via the requirejs text plugin.

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

Usage

Add 'mimosa-requirebuild-textplugin-include' to your list of modules. That's all! Mimosa will install the module for you when you start up.

Functionality

The 'mimosa-requirebuild-textplugin-include' module configuration is a pointer to a directory of files to include, the requirejs text plugin and a list of extensions to include in the r.js include array appended to the text plugin.

Default Config

requireBuildTextPluginInclude:
  folder: ""
  pluginPath: "vendor/text"
  extensions: ["html"]
  • folder: a string, a directory within the watch.javascriptDir that narrows down the search for files to include. If left alone, watch.javascriptDir is used.
  • pluginPath: a string, the AMD path to your requirejs text plugin
  • extensions: an array of strings, list of extensions for files to include in the r.js config's 'include' array attached to the text plugin at pluginPath path listed above. Ex: vendor/text!app/foo.html. All files in the watch.javascriptDir/folder that match this extension will be pushed into the array and already present array entries will be left alone. Extensions should not include the period.
npm loves you