Skip to content

adriankremer/rollup-plugin-proxy-directories

Repository files navigation

rollup-plugin-proxy-directories

creates proxy directories for libraries without configuration to make direct imports easier.

Example

Source

├── Button
│   ├── Button.tsx
│   ├── ButtonHook.tsx
│   └── index.ts
├── index.ts

Build

├── Button
│   ├── ButtonHook
│   │   └── package.json
│   └── package.json
├── es
│   ├── Button
│   │   ├── ButtonHook.js
│   │   └── index.js
│   ├── index.js
├── lib
│   ├── Button
│   │   ├── ButtonHook.js
│   │   └── index.js
│   ├── index.js

Usage

import Button from 'ui-library/Button';
import ButtonHook from 'ui-library/Button/ButtonHook';

inspired by this article: how-to-create-javascript-libraries-in-2018

Installation

npm install --save-dev rollup-plugin-proxy-directories

Usage

// rollup.config.js
import proxyDirectories from "rollup-plugin-proxy-directories";
import pkg from "./package.json";

export default {
  // ...
  plugins: [
    proxyDirectories()
  ]
};

todos (please contribute)

  • write tests :)

License

MIT

About

create proxy directories for libraries

Resources

Stars

Watchers

Forks

Packages

No packages published