Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @haensl/rollup-plugin-local-resolve with all npm packages installed. Try it out:

var rollupPluginLocalResolve = require("@haensl/rollup-plugin-local-resolve")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@haensl/rollup-plugin-local-resolve v1.0.5

Rollup plugin to resolve relative imports from local folders without stating the index file

rollup-plugin-local-resolve

NPM

npm version Build Status

Rollup plugin to resolve relative imports from local folders without stating the index file. E.g.

import something from '../some-dir'.

Quick start

  1. Install the plugin
npm i -D @haensl/rollup-plugin-local-resolve
  1. 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

Changelog

License

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free