Comments (7)
@olsonpm - well you may have a point, but I have a bunch of OS repositories which I'm quite happy taking usage questions on.
The way I see it, if I answer a question once, it's easy to search and refer people to again.
If it's a really good question, I can use it in the documention.
from nunjucks-loader.
I know everyone treats repos differently, but generally those questions are better fit for stack overflow after you've figured out a specific problem you're having.
from nunjucks-loader.
@davestewart Do you have a success in using Nunjucks with Vue?
from nunjucks-loader.
Currently I have trying to use it.
For temaplte like this:
<template lang="njk">
<div>Nunjucks!</div>
</template>
Vue template loader got string like this, instead of compiled template:
var nunjucks = require("nunjucks/browser/nunjucks-slim");
var env;
if (!nunjucks.currentEnv){
env = nunjucks.currentEnv = new nunjucks.Environment([], {"dev":false,"autoescape":true,"throwOnUndefined":false,"trimBlocks":false,"lstripBlocks":false});
} else {
env = nunjucks.currentEnv;
}
var dependencies = nunjucks.webpackDependencies || (nunjucks.webpackDependencies = {});
var shim = require("/var/www/node_modules/nunjucks-loader/runtime-shim");
(function() {(nunjucks.nunjucksPrecompiled = nunjucks.nunjucksPrecompiled || {})["resources/js/Domain/Invoices/Outgoing/Waybill/TestNunjucks.vue"] = (function() {
function root(env, context, frame, runtime, cb) {
var lineno = 0;
var colno = 0;
var output = "";
try {
var parentTemplate = null;
output += "\n<div>Nunjucks!</div>\n";
if(parentTemplate) {
parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);
} else {
cb(null, output);
}
;
} catch (e) {
cb(runtime.handleError(e, lineno, colno));
}
}
return {
root: root
};
})();
})();
module.exports = shim(nunjucks, env, nunjucks.nunjucksPrecompiled["resources/js/Domain/Invoices/Outgoing/Waybill/TestNunjucks.vue"] , dependencies)"
from nunjucks-loader.
From #24 I found nunjucks-html-loader. Seems it works well with vue-loader.
from nunjucks-loader.
Hey @likemusic - I haven't needed to since, so ended up ceasing investigations.
Good news about the loader though.
Is that related to your other project?
from nunjucks-loader.
@davestewart If you means vue-template-extends, then it not uses nunjucks-html-loader
at all (just vue
for parsing components and compile templates and jsdom to manipulate with templates html-code).
And I ended up ceasing investigations with nunjucks-html-loader
too, after get success with compile simple template from my 3rd comment, because I had an Epiphany with my loader. So because I trying to use nunjucks
just for extend templates, I currently use my loader, because its more lightweight and clear solution, then using 3-rd party template processor.
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
- Create 4x branch HOT 8
- 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
- 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.