Can't resolve 'webserver'
Hey, when packing our site with webpack which depends on texzilla, we run into #53 . If we then add "system" as a dependency, we get this warning message instead:
Module not found: Error: Can't resolve 'webserver' in './node_modules/texzilla'
@ ./node_modules/texzilla/TeXZilla.js
...
It seems like both this issue and #53 still need to be fixed. In #53 it sounds like you are not planning to fix it here - so maybe somewhere else?
I was not able to reproduce the error last time I tried. I think someone who can should probably investigate the cause and try and propose a patch for this.
I can see a require("webserver") that is in a try block [1], which is likely why this is a warning and not an error. And at least two references to system [2][3].
[1] https://github.com/fred-wang/TeXZilla/blob/master/commonJS.js#L181
[2] https://github.com/fred-wang/TeXZilla/blob/master/commonJS.js#L233
[3] https://github.com/fred-wang/TeXZilla/blob/master/commonJS.js#L249
So should https://github.com/fred-wang/TeXZilla/blob/master/package.json contains something more? I'm not very familiar with NPM
Looking at this list of suggestions [1], I found that if I replace all occurrences of require("system") with window.require("system") and require("webserver") with window.require("webserver") solves the issue for the packager. @fred-wang Will that also work when using it in the kinds of environments where these packages are available by default?
[1] https://stackoverflow.com/questions/34828722/how-can-i-make-webpack-skip-a-require
It seems like the fundamental issue here is that you use the same file as an import for other websites and the same file to run as a command line program. So it's choking on the bits that are only meant for commandline usage. Is that a fair assessment, @fred-wang ?
that's possible. I would need to check in details :-)
excellent. I hope to see a solution to this.