-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enable tree-shaking on data-format (#411)
- Loading branch information
1 parent
a2f30a8
commit c6e34ed
Showing
2 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable spellcheck/spell-checker */ | ||
import * as rnf_invoice_0_0_1 from './rnf_invoice/rnf_invoice-0.0.1.json'; | ||
import * as rnf_invoice_0_0_2 from './rnf_invoice/rnf_invoice-0.0.2.json'; | ||
import * as rnf_invoice_0_0_3 from './rnf_invoice/rnf_invoice-0.0.3.json'; | ||
|
||
// Re-export the JSON files structured by format and version. | ||
// NB: A dynamic require (require(`${format}/${format}-${version}.json`)) would prevent tree-shaking | ||
const formats: Record<string, Record<string, any>> = { | ||
rnf_invoice: { | ||
'0.0.1': rnf_invoice_0_0_1, | ||
'0.0.2': rnf_invoice_0_0_2, | ||
'0.0.3': rnf_invoice_0_0_3, | ||
}, | ||
}; | ||
export default formats; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters