I'm exploring ways to include html templates in a Webpack bundle using ngTemplate-loader and html-template-loader. While examining code from another project, I came across two lines that achieve this:
const templates = require.context(__dirname, true, /\.html$/);
templates.keys().forEach(templates);
The first line seems straightforward - it recursively requires all html files in the current directory and adds them to $templateCache.
However, the purpose of the second line is quite perplexing to me. Can anyone explain its significance?