rollup-plugin-local-resolve
Resolves index.js files with Rollup
Last updated 11 years ago by stoney .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rollup-plugin-local-resolve 
SYNC missed versions from official npm registry.

rollup-plugin-local-resolve

Resolves Node-style directories with index.js files in Rollup

Build Status Dependency Status devDependency Status Coverage Status

Rollup by default doesn't handle resolving ./folder to ./folder/index.js internally. While there is the rollup-plugin-node-resolve plugin which also resolves directories as well as all dependencies from the node_modules directory, these may sometimes be too much for the use case at hand.

Installation

npm install rollup-plugin-local-resolve

Usage

import { rollup } from 'rollup';
import localResolve from 'rollup-plugin-local-resolve';

// This will resolve `./files` to `./files/index.js` if the file exists
rollup({
  entry: './files',
  plugins: [localResolve()],
});

Things to improve on

  • Check for index.js file asynchronously
  • Use absolute paths instead of relative ones to be consistent with how Rollup handles modules

License

MIT, see LICENSE for more information

Current Tags

  • 1.0.7                                ...           latest (11 years ago)

8 Versions

  • 1.0.7                                ...           11 years ago
  • 1.0.6                                ...           11 years ago
  • 1.0.5                                ...           11 years ago
  • 1.0.4                                ...           11 years ago
  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 48
Today 0
This Week 2
This Month 34
Last Day 0
Last Week 14
Last Month 6
Dependencies (0)
None
Dev Dependencies (10)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE