1.2.0 • Published 4 months ago

bare-bundle-compile v1.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

bare-bundle-compile

Compile a bundle of CommonJS modules to a single module.

npm i bare-bundle-compile

Usage

const Bundle = require('bare-bundle')
const compile = require('bare-bundle-compile')

const bundle = new Bundle()
  .write('/foo.js', "module.exports = require('./bar')", {
    main: true,
    imports: {
      './bar': '/bar.js'
    }
  })
  .write('/bar.js', 'module.exports = 42')

eval(compile(bundle)).exports
// 42

API

const code = compile(bundle)

License

Apache-2.0

1.2.0

4 months ago

1.1.0

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago