@haensl/rollup-plugin-local-resolve
v1.1.12
Published
Rollup plugin to resolve relative imports from local folders without stating the index file
Downloads
33
Maintainers
Readme
rollup-plugin-local-resolve
Rollup plugin to resolve relative imports from local folders without stating the index file. E.g.
import something from '../some-dir'.
Quick start
- Install the plugin
npm i -D @haensl/rollup-plugin-local-resolve
- Use it in your
rollup.config.js
import localResolve from '@haensl/rollup-plugin-local-resolve';
export default {
input: 'src/index.js',
plugins: [
localResolve()
],
output: [
{
file: 'dist/index.cjs.js',
format: 'cjs'
},
{
file: 'dist/index.es.js',
format: 'es'
}
]
}
Credits
- Functionality inspired by Johannes Stein's rollup-plugin-local-resolve
- Unit tests inspired by rollup's own rollup-plugin-node-resolve