Comments (8)
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
from nunjucks-loader.
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 require
system.... it wasn't pretty... but it works.
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 nunjucks-loader
and I'll have a go polishing it up into a PR with tests/browser support.
from nunjucks-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.
from nunjucks-loader.
@chrisfarms Thanks for your input.
A custom Loader that leverages require
sounds like a better approach than rewriting the runtime... so yes, I think this could be a good direction :)
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).
from nunjucks-loader.
how about webpack 4.x support?
from nunjucks-loader.
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.
from nunjucks-loader.
@chrisfarms any updates ?
from nunjucks-loader.
@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.
from nunjucks-loader.
Related Issues (20)
- 2.4.6 breaks webpack builds HOT 3
- Version 2.4.7 broke compatibility HOT 2
- webpack2 support HOT 1
- Doesn't work with extract-text-webpack-plugin
- opts key for query not working HOT 2
- DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic HOT 2
- Can't add custom filters and extensions
- -v HOT 1
- Is this usable to inject script tags ? HOT 1
- Configurable `autoescape` is still enabled in browser environment HOT 2
- Cannot read property 'context' of undefined HOT 2
- webpack 4.x release HOT 2
- Options are not being passed to browser environment
- Images handling in nunjucks template
- Load config file via webpack loaders HOT 3
- Can't get Nunjucks loader working in Vue JS HOT 7
- Relative paths are not being resolved HOT 2
- Inline svg loader returns [object Object] HOT 1
- Vulnerabilitie in loader-utils.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nunjucks-loader.