rJS Redundancy Checker v0.3.0

This tool, cross-references your rJS (requireJS optimiser) build log with the public assets in your project and highlights which files are not being bundled and potentially not needed anymore. Useful if you want to keep redundancy in your codebase to a minimum. It comes with a set of configurable options which are explained below.

Installation

npm install rjs-redundancy-checker

Options Explained

Name Type Description
pathToProject String (required) absolute path to project root
publicAssetDirPath String (required) relative path (from 'pathToProject') to folder with public assets
buildLogPath String (required) relative path (from 'pathToProject') to rjs build log
extensions Array (required) an array of file types (not including '.') to search for during scan for public assets
directoriesToIgnore Array (optional) | Default = [] an array of relative directory paths (from 'publicAssetDirPath') to ignore during scan for public assets
filesToIgnore Array (optional) | Default = [] an array of relative file paths (from 'publicAssetDirPath') to ignore during scan for public assets
allFilePath String (optional) | Default = "" relative path to location (including file name) to list all public assets
usedFilePath String (optional) | Default = "" relative path to location (including file name) to list used public assets
unUsedFilePath String (optional) | Default = "" relative path to location (including file name) to list unused public assets
disableConsoleLogs Bool (optional) | Default = false control whether to output info to console

Gotchas

  • make sure the paths in the compiled rjs build log start from the same location as where you're running the tool from else you will end with it reporting that all files are redundant

Changelog

0.3.0 (22 Jan 2015)

  • adds package json
  • converts rjs-redundancy-checker into a node package
  • adds 'disableConsoleLogs' setting
  • improves documentation
  • splits example usage into separate directory

0.2.0 (31 Aug 2014)

  • replaces PHP implementation with JavaScript as it just makes more sense seeing this is a JS tool

0.1.0 (28 Aug 2014)

  • initial PHP implementation

Suggestions, comments and queries welcome, send to aaron@burtdev.net