Open john916zhang opened 4 years ago
You can just do e.g.,
import { bcv_parser as eng_bcv_parser } from "bible-passage-reference-parser/js/en_bcv_parser"
This is becoming more brittle in some environments:
'bcv_parser' is not exported by node_modules/bible-passage-reference-parser/js/en_bcv_parser.js
@cco3 It looks like the best approach to maintain both the old and the new import styles is to create a new directory with files that use the new style and add a statement to the package.json file. Does that sound like the right approach?
Yes, basically just use new-style imports and run it through something like vite or rollup to create outputs in a dist directory which are referenced in package.json.
Thanks for developing this wonderful library. Just a quick question. How to import this library as a ES2015 module?
var bcv_parser = require("bible-passage-reference-parser/js/en_bcv_parser").bcv_parser;
I'd like to use ES2015's
import
instead of CommonJS'srequire
.