Closed rnadler closed 4 years ago
I'm not using Typescript so I cannot be sure this works, but assuming it follows es modules:
index.js
file define:
export default {
Parser: Parser,
Expression: Expression
};
Which means you cannot import Parser directly (using es module), you need to use an intermediate variable:
import ExprEval from 'expr-eval';
const {Parser} = ExprEval;
To fix it index.js
should be defined without specifying default (along with current default to avoid compatibility issues)
export {
Parser: Parser,
Expression: Expression
};
Thanks for reporting this. I'm not sure what my original reason for using export default was, but I added exports for Parser and Expression, which I believe (like @Cactusbone mentioned) should fix the issue. Can you try this with version 2.0.2, and let me know how it goes?
I can confirm that 2.0.2 resolves export issue. Thanks!
@rnadler Great, thank you!
I have a Typescript project with:
The above works fine with 1.2.3 but 2.0.1 compilation fails with:
Versions: typescript: 3.5.3 webpack: 4.40.2
I'm probably missing something simple, but I can't seem to find a solution. Thanks!