I have a project with WebPack, where modules are imported with CommonJS structure.
Now I need to import the ePOS_SDK_JavaScript_v2.7.0
library (file "epos-2.7.0.js").
But it is not a valid CommonJS module.
How can I import the library in my project?
Thanks
After some hours I found a simplest solution.
1) edit epos-2.7.0.js
file
Insert this row in top of file:
var io = module.exports;
2) import the library
The SDK is not pretty recognized by CommonJS, then it is required to declare the epson
variable:
import '../<path>/epos-2.7.0.js';
declare var epson;
import '../<path>/epos-2.7.0.js';
declare var epson: any;