Closed myst729 closed 7 years ago
I think a better way is to use a build tool to generate the JS file. So that we don't have to manually maintain two files.
I have a similar project that wraps LiveRe into a vue component, which is using webpack. Then I only need to maintain the *.vue file and build the JS dist file.
Also, the dist JS only exports the component's content. The developer who uses it need to register the component in his code. This makes the developer's project dependencies more readable.
How about this approach?
Perfect! Thanks for this contribution, I will merge and push a new version already with its changes. Actually this change to support UMD is really necessary, making it even easier.
Thanks
The major change is in vue-disqus.js. With umd support, the component is adaptive to more use cases.
There are some breaking changes though:
Since it's umd ready, the
main
field in package.json is pointed to the JS file now. This favors people that don't use webpack or browserify in their projects.As Disqus has occupied the namespace
DISQUS
, for concerns of clearness, the component's name is altered tovue-disqus
(wasdisqus
), and the global variable isVueDisqus
. The changes has been reflected in the README.