Thanks to visit codestin.com
Credit goes to github.com

Skip to content

saykumar/bunpack

 
 

Repository files navigation

bunpack

A super light weight implementation of the basic function of webpack/vite as a UI development tool but with bun as the bundler

Setup:

bun add -D bunpack

To run:

bunx bunpack-serve // In the same directory of your bunpack.config.ts
bunx bunpack-build // In the same directory of your bunpack.config.ts
bunx bunpack-serve -c ./some/path/to/bunpack.config.ts

run example

bun serve-example
bun build-example
export interface BunpackBundleOptions {
    // Right now bun doesn't create correct trailing sourcemap url comments
    // Turning this on will enable a patching of all files with sourcemaps
    // The serve sets the SourceMap header as well but not all browser support it
    patchSourceMaps?: boolean
    // Behaves like the html template plugin for webpack works for both serve and build
    htmlTemplate?: {
        templatePath?: string
        templateOutputPath?: string
        scriptTagArgs?: Record<string, string>
        styleTagArgs?: Record<string, string>
    }
}

export type BunpackBunBuildConfig = BunBuildConfig & BunpackBundleOptions
export type BunpackEsbuildBuildConfig = BuildOptions & BunpackBundleOptions

export interface BunpackConfig {
    bunBundleConfig?: BunpackBunBuildConfig
    esbuildBundleConfig?: BunpackEsbuildBuildConfig
    devServer: {
        watchDir: string
        port: number
        host?: string
        tls?: TLSOptions
        https: boolean // webpack style auto gen keys
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.4%
  • HTML 1.6%