kanasimi / wikiapi

JavaScript MediaWiki API for node.js
https://kanasimi.github.io/wikiapi/
BSD 3-Clause "New" or "Revised" License
48 stars 6 forks source link

Add _Cel.loader.nodejs.js to fix build error in webpack #2

Closed jalavosus closed 4 years ago

jalavosus commented 4 years ago

When building a webpack project which includes wikiapi as a dependency, webpack fails to build the project due to wikiapi.js requiring _CeL.loader.nodejs.js in a try/catch block, which doesn't exist in the wikiapi project folder.

One easy solution to this problem is to simply include the file so that builds don't fail. Another solution is to remove the require altogether.

codecov-io commented 4 years ago

Codecov Report

Merging #2 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #2   +/-   ##
=======================================
  Coverage   77.22%   77.22%           
=======================================
  Files           1        1           
  Lines         101      101           
=======================================
  Hits           78       78           
  Misses         23       23

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 930358f...6e4cdfc. Read the comment docs.

kanasimi commented 4 years ago

@jalavosus Hi. Thank you very much for using the module. I used _CeL.loader.nodejs.js only for debugging locally: https://github.com/kanasimi/wikiapi/blob/930358f2f8e15d4df05cc1562303d49deeaa31cd/wikiapi.js#L7-L11 And if possible, I think it is better using CeL = require('cejs') instead of _CeL.loader.nodejs.js. May you show me the example code using wikiapi and the error messages? Thank you.

kanasimi commented 4 years ago

@jalavosus Thank you for your testing. If no other issues, this request will be closed.