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

Uncaught ReferenceError: module is not defined #60

Closed NucleaPeon closed 7 years ago

NucleaPeon commented 7 years ago

I'm not using bower or npm to install what-input.js, I'm simply using the src file. My import tag:

<script src="js/vendor/what-input.js"></script>

It exists at that location because it was working with a previous version at the same location.

I'm getting an error:

Uncaught ReferenceError: module is not defined
    at what-input.js:1

Am I doing something wrong in my usage/installation, or is this an actual bug? Using latest master branch as of May 23, 2017 (4pm).

Using Chrome Version 58.0.3029.110 (64-bit) on Mac OS X 10.12.5

NucleaPeon commented 7 years ago

As an aside, I would also like to suggest adding in a version variable into the source file, or a version comment.

ten1seven commented 7 years ago

Hi @NucleaPeon. Yes the file locations got moved around when I updated to use Webpack. Your new file location is dist/what-input.js or dist/what-input.min.js. I'll make a note to add a version variable. Thanks!

NucleaPeon commented 7 years ago

Works perfectly! Thank you