1.1.1 • Published 7 years ago
rollup-plugin-local-resolving v1.1.1
rollup-plugin-local-resolving
Resolves Node-style directories with index.js files in Rollup. This is forked from https://github.com/frostney/rollup-plugin-local-resolve.
Rollup by default doesn't handle resolving ./module to ./module.js or ./module/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-resolvingUsage
import { rollup } from 'rollup';
import localResolve from 'rollup-plugin-local-resolving';
// This will resolve `./files` to `./files.js` or `./files/index.js` if the file exists
rollup({
entry: './files',
plugins: [localResolve()],
});Options:
{
// `extensions` is an optional array with all extensions expected to be resolved. Defaults to ['.js'] when omited.
extensions: ['.js', '.jsx']
}Things to improve on
- Check for
index.jsfile asynchronously
License
MIT, see LICENSE for more information