-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create 4x branch #60
Comments
I was just trying to solve this problem (making a loader for node-side that plays nicely with html-loader). It looks like I'll be using nunjucks for some time at work so I might be interested in helping out on this project. I took a slightly different approach by parsing the templates during the "pitch" phase so that we can collect all the required templates sources and use a custom Loader to pull them out of the It's a shame there's no way to fully precompile the templates AND support other loaders since I'm sure there's some tree shaking that we will miss out on. Anyway... I just pushed a PoC here: https://github.com/chrisfarms/njk-loader Since I don't need browser compilation I didn't even attempt to solve that, but the same technic should work. Let me know if you think this might be a good direction for |
@chrisfarms Thanks for your input. Give me a week (to find some time) and I will update the sibling packages in the 3.x branch with test suites for specific scenarios (node, browser, umd, template inheritance, filters, macros etc). |
how about webpack 4.x support? |
I continued to mature the version I was working on at chrisfarms/njk-loader#2 ... it should now work for browsers and webpack 4 ... hopefully I'll find some time this weekend to finish up adding tests ... but if @at0g can get some test in here I'd be happy to port it over to here rather than creating yet another loader. |
@chrisfarms - sorry about the delay... there is a lot going on with life at the moment. I'll try for tests this week. Failing that, I agree with not creating another loader, so will gladly hand over the module name if you want to maintain it. |
Thanks at0g ... I'd def be interested in taking over maintaining the module if you're not very active in the nunjucks space these days.... however what would be even better for the community is if I can get my workplace to adopt the project ... they are using nunjucks in a few projects so I'll see if I can drum up some support |
@chrisfarms any updates ? |
@at0g @chrisfarms Are there any updates on this? Trying to decide on a template engine and loader, so figured I'd drop a quick message here. |
Disclaimer:
While I maintain this repo, I don't use nunjucks and have not done so for several years now. It does not suit my style of work, but I can appreciate that it may be good for others. If you would like to step up to become a maintainer of this package, contributing to this release would be the way to go.
I have started working on a
3.x4.x version of this module, which can be seen here:https://github.com/at0g/nunjucks-loader/tree/3x
Currently the new branch has a working example using html-webpack-plugin; along with a browser only version.
As of nunjucks@2, their packaging approach is literally hostile to UMD.
This makes it very difficult to support code that runs in the node environment (html-webpack-plugin, extract-text-plugin etc). Instead, I have opted for the following approach:
The caveat is this:
My concern with doing this is that it's fairly common to branch other code based on
typeof window !== 'undefined'
.The text was updated successfully, but these errors were encountered: