bun

@transclusion/bundle

Simple and efficient file bundling for Node.js.

Showing:

Popularity

Downloads/wk

7

Maintenance

No Maintenance Data Available

Package

Dependencies

1

Size (min+gzip)

1.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

@transclusion/bundle

Simple and efficient file bundling for Node.js.

yarn add @transclusion/bundle --dev

build status npm version

Usage

CLI

usage: bundle <command> <options>

  Commands:
  – build
  – watch

When using the CLI, add a .bundlerc to the project root:

{
  "name": "main",
  "dest": "./dist",
  "source": "src/client",
  "target": "[name][ext]",
  "plugins": [
    ["babel", {"presets": ["flow", "env"]}],
    "commonjs",
    "iife",
    "uglifyjs"
  ]
}

API

bundle can also be used as a Node.js module.

Example

import bundle from '@transclusion/bundle'
import bundlePluginCommonjs from '@transclusion/bundle-plugin-commonjs'
import bundlePluginIife from '@transclusion/bundle-plugin-iife'
import path from 'path'

bundle.build({
  name: 'main',
  basedir: __dirname,
  dest: path.resolve(__dirname, 'static'),
  source: './main.js',
  output: '[name][ext]',
  plugins: [
    bundlePluginCommonjs,
    bundlePluginIife
  ]
}).then(() => {
  console.log('bundled main.js')
}).catch(err => {
  console.error(err.stack)
  process.exit(1)
})

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100