Closed daslicht closed 8 years ago
You can't just require a template like that: require only works with valid JavaScript unless you hack it with a transform.
Ok , so how would look that complete example, please:
source: https://github.com/mozilla/nunjucks/issues/507
"browserify": {
"transform": [
"browserify-shim"
]
},
"browserify-shim": {
"nunjucks": "nunjucks"
}
so I need another transform ?
I tried it like this, but that didnt work either : https://github.com/rotundasoftware/nunjucksify/issues/16
Do I need to combine browserify-shim
and nunjucksify
?
How please?
No idea, I prefer to not use transforms to allow invalid JS and instead use brfs
hm but that wont precompile nunjucks templates no ?
Correct, I don't really know what the tooling looks like for Nunjucks and can't be of much help here
check out nunjucksify, i believe that is the transform you are looking for
@dgbeck I tried it like this, but that didnt work either : rotundasoftware/nunjucksify#16
Hi @daslicht sorry to hear that. nunuckisfy is currently broken because recent versions of nunjucks are not common-js compatible, due to https://github.com/mozilla/nunjucks/issues/507 . I am currently working to try to get some movement on that issue which has been stalled for some time.
any news on this ?
@daslicht thanks for the heads up. now that nunjucks 3 is out we can move forward. just merged #19 and published nunjuckify to npm @2.0.0.
very happy to close this issue after so long. thank you!
Hi, I I have the following setup:
test.js
myWidget.nunj:
package.json:
bundle include:
bundle.js returns the following:
What do I miss , please?