SudoCat / Nunjucks-Isomorphic-Loader

Nunjucks loader for webpack, supporting both javascript templating and generating static HTML files through the HtmlWebpackPlugin.
MIT License
16 stars 5 forks source link

Make root path dynamic #6

Closed sebbdk closed 6 years ago

sebbdk commented 6 years ago

The root path is not dynamic currently.

Specifically, if you have multiple entry points via HtmlWebpackPlugin, then it will always look for the first root dir, this causes the nunjuck files of subsequent HtmlWebpackPlugin instances to not be found.

I added a method that matches the paths and selects the appropriate root path.

SudoCat commented 6 years ago

Nice one 👍 this all looks good to me, so I'll go ahead and merge it on in!

Thanks for your contributions, I rarely get a chance to look at this package anymore, glad it's still useful to some people! 😄

sebbdk commented 6 years ago

Awesome, thank you for the quick response!

SudoCat commented 6 years ago

That's all right, just happened to be on here at the time. I'll try and get the package published to npm soon, just need to make sure there aren't any breaking changes (doesn't look like there would be, but best to be careful!).