open-index/open-npm huggingface dataset:
npm package: @phantom-labs/parcel-optimizer-suspend-amd
Description: Suspends and then reenables usage of AMD for parcel generated js files 
Author: Phantom Labs
Latest version: 0.0.3

# parcel-optimizer-suspend-amd

> What it fixes: Parcel breaks isolation by always exposing modules, causing a "Mismatched anonymous define()" error. if script is loaded any other way than via require.

Background of this optimizer is the following issue: https://github.com/parcel-bundler/parcel/issues/2451

This plugin wraps your bundle to:

1. Caches reference to global define object to avoid conflicts with other global define objects (such as AMD's define function) before your content
2. Restores global define object after your content

## Usage

```
// .parcelrc
{
  "extends": "@parcel/config-default",
  "optimizers": {
    "*.js": ["@parcel/optimizer-terser", "@phantom-labs/parcel-optimizer-suspend-amd"]
  }
}
```

## Thanks

Inspired by

- https://github.com/glomex/parcel-optimizer-disable-amd
- https://github.com/albinotonnina/parcel-plugin-wrapper

## License

Apache 2.0 License