Open akarelas opened 7 years ago
I.e. please make it play nicely with Webpack
+1 @akarelas did you find a solution?
No
I just made it work like this:
require('messenger/build/js/messenger');
@akarelas You can import it because inside the lib we haven't any export and the lib work with the global window object. You only can do like:
import 'messenger/build/js/messenger';
If the npm package.json included a main tag like this:
"main": "build/js/messenger.js",
then it would work better and it could be imported like this:
import 'messenger-hubspot';
(I am going off of the npm package called messenger-hubspot.
I can confirm this works after installing from npm
import 'messenger-hubspot/build/js/messenger';
Please do what you must, so that I can do:
let Messenger = require('messenger');
or...
import Messenger from 'messenger';