ten1seven / what-input

A global utility for tracking the current input method (mouse/pointer, keyboard or touch).
https://ten1seven.github.io/what-input
MIT License
1.35k stars 89 forks source link

RequireJS fails ~ missing amd support #51

Closed artursopelnik closed 7 years ago

artursopelnik commented 7 years ago

Currently we use "what-input" in version "2.1.1". Because it is the last working version for our development process with requirejs.

Version 3 and up loaded uncorrectly. Unfortunately there is no error message ...

Could you try to import dist files via requirejs …

ten1seven commented 7 years ago

Hi @artursopelnik, I'll take a look into it.

ten1seven commented 7 years ago

Hey @artursopelnik, I gotta admit, this is tripping me up. In the current version I'm supporting UMD via Webpack. Do you have any suggestions for a UMD/AMD compatible wrapper?

artursopelnik commented 7 years ago

Sorry it was my mistake. You have to be include it with the same module name.

Before: 'what-input': '../../node_modules/what-input/dist/what-input',

After: 'whatInput': '../../node_modules/what-input/dist/what-input',

It is unusual that filename and module name are different. Maybe it makes sense to adjust.

ten1seven commented 7 years ago

Ah, yes. Good find! I don't want to make a change that would break this for others so I'll add how to do this to the README and keep it in mind for the next major update. Thanks!