How i get version from package.json
?
I have project angular 5
Angular-Cli: 1.6.7
and npm 5.6.0
My file enviroment.ts:
export const enviroment = {
VERSION: require('../package.json').version
}
This file it is in src/app/enviroment.ts
The file package.json it is in src/package.json
When compile, the angular cannot found the file package. here is the error:
Module not found: Error: Can't resolve '../package.json'
I follow this answer, but no success here