Open kidwm opened 8 years ago
Yeah, I have no problem with that. I will say I originally tried to use node-ssi, but wanted to also create a caching system, similar to sass. So I found it difficult to integrate with node-ssi. But this is all yours now. I will note that you might want to upgrade the version of grunt it relies on. Let me know if you have any questions.
@anguspiv Thank you, if you were still interested to create a caching system in node-ssi
, welcome to contribute!
There's also @yanni4night's node-ssi
which I use and can vouch for. What's the difference between these two node-ssi projects?
Oh, one difference that I've found is that ssi
's API requires the creation of files whereas @yanni4night's node-ssi
does not. That's very convenient for creating middleware using grunt-contrib-connect
(something that I'm working on right now).
Yep! :smile:
grunt-contrib-connect
works great with @yanni4night's node-ssi
, no need for any temporary cache files or new grunt plugins, just do:
connect: { // https://github.com/gruntjs/grunt-contrib-connect
options: {
port: 8000,
base: 'dist',
livereload: true,
middleware: (connect, opts, middlewares) => {
middlewares.unshift((req, res, next) => {
var f = url.parse(req.url).pathname
f = path.join('dist', S(f).endsWith('/') ? f + 'index.html' : f)
if (S(f).endsWith('.html') && fs.existsSync(f)) {
ssi.compileFile(f, (err, content) => {
if (err) {
console.error(err.stack)
throw err
}
console.log(`Req: ${req.url} => sending node-ssi parsed file: ${f}`)
res.end(content)
})
} else {
next()
}
})
return middlewares
}
},
dev: {}
}
Did this endeavor come through yet? I would very much like the functionality of node-ssi in a grunt task, but I'm not sure that it's possible without it being an actual grunt task module.
@thany Not yet, thanks for your appreciation. I'm still busy with my new daily job. Hope to find some time for it soon.
Hi, I'm the new maintainer of node-ssi.
https://github.com/kidwm/node-ssi
I can take over this project and make this grunt plugin based on node-ssi.
my npm id is also kidwm, how do you think, would you like to transfer it to me?