Open gregveres opened 6 years ago
I found a work around with webpack.
given the current state of the package.json, you have to do this:
import "messenger-hubspot/build/js/messenger.js";
but if you add this to the plugin section of your webpack config, you can work around the lack of a main tag:
new webpack.NormalModuleReplacementPlugin(/^messenger$/, 'messenger-hubspot/build/js/messenger.js'),
then you can just do this to import the module:
import "messenger"
It would be a lot cleaner for users of the package if it had a main attribute as described in this SO answer. https://stackoverflow.com/questions/22512992/node-js-package-json-main-parameter
I think the main should be: 'main': 'build/js/messenger'