Include json file in ng-packagr build
问题 I want to import json file into my Angular 5 app and then build a lib. I can do the first part by including this code declare module "*.json" { const value: any; export default value; } to typings.d.ts , but when I try to build it it fails with error Cannot find module '../../assets/locale-en.json'. Any way to fix it? 回答1: In the end I just wrote script to convert json file to ts file and added it to script command for packagr build in package.json . package.json scripts: { "packagr": "node .