creates proxy directories for libraries without configuration to make direct imports easier.
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
npm install --save-dev rollup-plugin-proxy-directories
// rollup.config.js
import proxyDirectories from "rollup-plugin-proxy-directories";
import pkg from "./package.json";
export default {
// ...
plugins: [
proxyDirectories()
]
};
- write tests :)
MIT