Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

enhance-require

1.0.4 • Public • Published

enhance-require

In node, modifies the behaviour of require so that it ignores paths containing .css, .less, .scss, .sass, and any other paths indicated via the exclude option. Outside of node (browserify, webpack, etc.), this function does nothing.

Build Status js-standard-style npm version Coverage Status

const enhanceRequire = require('enhance-require')
enhanceRequire({
  package: true,
  exclude: '/scratch/'
})
require('styles.less') // ignored in node, processed elsewhere
// Don't forget to add a browserify transform or similar for non-node
var pkg = require('package.json') // pkg is the parsed package from the current working directory
enhanceRequire.restore()

install

npm i enhance-require

Downloadsweekly downloads

17

version

1.0.4

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability