WICG / inert

Polyfill for the inert attribute and property.
Other
924 stars 81 forks source link

Error: Mismatched anonymous define() module: #114

Closed y-a-v-a closed 5 years ago

y-a-v-a commented 5 years ago

Hi, I still use requirejs: https://requirejs.org/ . Salesforce uses your module in their LiveChat. Your built version uses an anonymous define. RequireJS doesn't like that (see also https://requirejs.org/docs/errors.html ). LiveChat breaks our pages due to the anonymous define. This could quite easily be fixed, for example like this:

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
  typeof define === 'function' && define.amd ? define(['inert'], factory) : // give it a name
  (factory());
}(this, (function () { 'use strict';

Cheers Vincent

y-a-v-a commented 5 years ago

Easiest of course would be to update the configuration in rollup.config.js and add a name property for the output. See also https://rollupjs.org/guide/en#big-list-of-options

y-a-v-a commented 5 years ago

Fixed in #119