Open pveller opened 2 years ago
Same problem here. Any quick fixes for this?
Was a fix for this issue found?
It seems like esbuild is shaking off the include
folder. That being said, can you guys create a repro project with esbuild and the input that is creating this problem? I can look in to it and attempt a fix.
I just switched to https://github.com/JSONPath-Plus/JSONPath
Hi ! It's shaked off because both files in the missing "include" folder are required dynamically (no static require / import from) : https://github.com/dchester/jsonpath/blob/master/lib/grammar.js#L102
if (fs.readFileSync) {
grammar.moduleInclude = fs.readFileSync(require.resolve("../include/module.js"));
grammar.actionInclude = fs.readFileSync(require.resolve("../include/action.js"));
}
This syntax forbids all usage of this library with a bundler (esbuild, webpack, nx, ...) that uses tree shaking...
this dynamic import needs to be fixed it breaks a lot of things
Would you mind to take a look on this issue and the proposed fix #172 @dchester?
There are large players using your library as their dependency, I'm currently getting issues through contentful-export being dependent on this library.
Maintaining open-source library aside from your daily job is probably huge hassle, maybe it would be worth to consider picking some of the helpful fellows from active PR openers as contributors with a merge rights?
Hey guys,
awesome library. Love it! But I can't use it in lambda packaged with
esbuild
without some hacking because of this:https://github.com/dchester/jsonpath/blob/master/lib/grammar.js#L102
It comes down to this in runtime:
There are no files other than nicely bundled
index.js
afteresbuild
Thanks!