Open w9 opened 9 years ago
I can confirm this happening. The paths to inlined sources are messed up after the jade pipe. I wasn't able to fix it with rootpath
option.
+1
I will take a look this weekend.
Any progress on this issue?
+1
Hi rhere I know this is a old post, hope someone can chip in or has resolved this?
I am having a similar problem with .nunjucks files using gulp-nunjucks-render
gulpfile.js
pipe(nunjucksRender({ path: njkPaths, ext: "", data: ENV_VARS, envOptions: { trimBlocks: true, lstripBlocks: true } })) .pipe(inlineSource({ compress: false, saveRemote: true, handlers: [require("./nunjucksHandler.js")] }))
nunjucksHandler.js ?
const Nunjucks = require('nunjucks'); module.exports = function nunjucks(source, context) { return new Promise((resolve, reject) => { if ( source.fileContent && !source.content && source.type == "text/css" ) { let content; try { content = Nunjucks.precompile(source.fileContent); } catch (err) { return reject(err); } // Need to expose templates for later use somehow... source.content = content } resolve(); }); };
I was trying the precompile approach https://github.com/popeindustries/inline-source/issues/70#issuecomment-384548345 but got nowhere.
Thanks
I have a simple testing folder:
a.js
gulpfile.js
test.jade
However after running
gulp
, the outputtest.html
doesn't includea.js
inline as expected: