In an angular cli project, I managed to embed json like this
- add to
typings.d.ts
declare module "*.json" {
const value: any;
export default value;
}
- import .json
import * as data from '../assets/data.json';
But if I want to compile this into an Angular 5 module with ng-packagr, I get the following error:
Error at .../.ng_pkg_build/my-module/ts/src/app/my-module.module. ts:28:33: Cannot find module '../assets/data.json'.
Did anyone encountered this issue and knows how to solve it?