3

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 .

Milad
  • 27,506
  • 11
  • 76
  • 85

0 Answers0