1.0.6 • Published 7 years ago

@transclusion/bundle v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

@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)
})
1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago