# bundle-marked-loader

> bundle loader module for webpack with marked lazy function

Latest version **1.0.4** (published 2017-02-28) · 0 weekly downloads

## Install

```sh
npm install bundle-marked-loader
pnpm add bundle-marked-loader
yarn add bundle-marked-loader
bun add bundle-marked-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-02-28 |
| First published | 2016-09-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | le0nik |

## Links

- npm: https://www.npmjs.com/package/bundle-marked-loader
- Repository: https://github.com/le0nik/bundle-marked-loader
- Homepage: https://github.com/le0nik/bundle-marked-loader#readme
- Issues: https://github.com/le0nik/bundle-marked-loader/issues
- npm.io page: https://npm.io/package/bundle-marked-loader

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) 0.2.x

## Recent versions

- 1.0.4 (latest) — 2017-02-28
- 1.0.3 — 2017-02-28
- 1.0.2 — 2017-02-19
- 1.0.1 — 2017-01-31
- 1.0.0 — 2017-01-31
- 0.7.0 — 2017-01-31
- 0.6.1 — 2016-09-14
- 0.6.0 — 2016-09-14

## README

# bundle marked loader for webpack

Fork of [https://github.com/webpack/bundle-loader](https://github.com/webpack/bundle-loader)

## Usage

[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)

``` javascript
// The chunk is requested, when you require the bundle
var waitForChunk = require("bundle!./file.js");

console.assert(waitForChunk.__asyncModule === true); // function is marked with `__asyncModule` flag

// To wait until the chunk is available (and get the exports)
//  you need to async wait for it.
waitForChunk(
	function(file) {
		// use file like is was required with
		// var file = require("./file.js");
	},
	function(error) {
		// error while loading chunk (error callback is only available in webpack >= 2.2.0)
	}
);
// wraps the require in a require.ensure block
```

The file is requested when you require the bundle loader. If you want it to request it lazy, use:

``` javascript
var load = require("bundle?lazy!./file.js");

console.assert(load.__asyncModule === true); // function is marked with `__asyncModule` flag
console.assert(load.__lazyModule === true); // function is marked with `__lazyModule` flag

// The chunk is not requested until you call the load function
load(
	function(file) {
	},
	function(error) {
		// error while loading chunk (error callback is only available in webpack >= 2.2.0)
	}
);
```

You may set name for bundle (`name` query parameter). See [documentation](https://github.com/webpack/loader-utils#interpolatename).

``` javascript
require("bundle-marked-loader?lazy&name=my-chunk!./file.js");
```

## License

MIT (http://www.opensource.org/licenses/mit-license.php)

---
_Source: https://npm.io/package/bundle-marked-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
