Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flatten-dir plugin for importing directories #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CNSeniorious000
Copy link

@CNSeniorious000 CNSeniorious000 commented Sep 17, 2024

Awesome Contribution Checklist:

  • I have read, and re-read the Contributing Guidelines
  • I have searched to ensure the suggested item doesn't exist on this list
  • This PR contains only one item

Please Provide a Link A Repository for Your Addition

https://github.com/promplate/rollup-plugin-flatten-dir

Please Describe Your Addition

This package can import a directory into module whose default export is a Record<string, string>. The keys are file pathes and values are file contents.

This format is used in StackBlitz's SDK for submitting files onto its workspace. With this rollup plugin, people can easily embed StackBlitz demos in their rollup/vite websites.

Besides, it is easy to load files into Pyodide's filesystem with this plugin, which is also good to make use of vite's HMR feature to work with Pyodide.

Here is a simple demo for its functionality:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant