Cannot use in bundled application - missing package.json
bagr001 opened this issue ยท 4 comments
Hi, thank you for your work, I love your integration.
I used this plugin in my app that is bundled into single file during build, but i stumbled on an obstacle.
During runtime, there si require
call for package.json
via relative path, which cannot be bundled at current state.
Is there a possibility to change this behavior to support code bundling?
I've tested one sollution. Changing
const PACKAGE_NAME = require(path.resolve(__dirname, 'package.json')).name;
to
const PACKAGE_NAME = require('./package.json').name;
would help :-)
Thanks!
Line 16 in 1838067
Hi @bagr001 , thank you for opening this. Yes it's possible, PRs are welcome if you have the time to work on it ๐ . Otherwise I'll look into it
We could also just hardcode the plugin name in the exports
๐
We could also just hardcode the plugin name in the
exports
๐
Yep, I second this, it's just a string that won't change, we'll one less thing to worry about if/when moving to ESM ๐