-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
can we add a node style done callback?
I was thinking of something like this:
nodeRev({
files: './build/public/bundle.css,./build/public/bundle.js',
outputDir: './build/public/',
file: './build/manifest.json',
hash: true
}, (err, result) => {
if(err){
// handle
}
console.log(result)
})
then we can promisify it
const _nodeRev = require('node-rev').default
const promisify = (ctx, func = ctx) => (...args) => {
return new Promise((resolve, reject) => {
func.apply(ctx, [...args, (err, result) => err ? reject(err) : resolve(result)])
})
}
const nodeRev = promisify(_nodeRev)
const rev = () => nodeRev({
files: './build/public/bundle.css,./build/public/bundle.js',
outputDir: './build/public/',
file: './build/assets.json',
hash: true
})
rev().then((manifest) => console.log(manifest))
Metadata
Metadata
Assignees
Labels
No labels