We used to be able to to do this :
let path = 'test.component.ts';
let file = require('./path/to/file/'+path);
console.log('file',file);
But this is not working any more with the latest cli.
This works :
let file = require('./path/to/file/test.component.ts');
console.log('file',file);
So basically , webpack wont let me require file dynamically anymore in cli .
${someVar}
` – Ankit Singh Dec 27 '16 at 08:37