webcontainer-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

webcontainer-utils

NPM version

webcontainer-utils is a small utility package for WebContainers. Currently there are only a small number of utils. More will be added in the future. If you have any suggestions feel free to open an issue or a PR!

convertRawGlobImportToFileSystemTree()

Converts a Vite raw glob import into Webcontainers FileSystemTree structure.

Usage

import { WebContainer } from '@webcontainer/api'
import { convertRawGlobImportToFileSystemTree } from 'webcontainer-utils'

const files = import.meta.glob('./playground/**/*.*', { as: 'raw' })
const filesystem = await convertRawGlobImportToFileSystemTree(files)
const container = await WebContainer.boot()

container.mount(filesystem)

License

MIT License © 2023 Jacob Clevenger

Readme

Keywords

none

Package Sidebar

Install

npm i webcontainer-utils

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

5.83 kB

Total Files

6

Last publish

Collaborators

  • wheatley