Last active
September 16, 2021 16:57
-
-
Save webrgp/3c346c78d9cda43d6ef9322f924c2b0d to your computer and use it in GitHub Desktop.
Blendid Configuration for working with Twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"src": "./src", | |
"dest": "./public", | |
"html": { | |
"src": "html", | |
"dest": "./" | |
}, | |
"static": { | |
"src": "static", | |
"dest": "./" | |
}, | |
"javascripts": { | |
"src": "javascripts", | |
"dest": "assets/javascripts" | |
}, | |
"stylesheets": { | |
"src": "stylesheets", | |
"dest": "assets/stylesheets" | |
}, | |
"images": { | |
"src": "images", | |
"dest": "assets/images" | |
}, | |
"fonts": { | |
"src": "fonts", | |
"dest": "assets/fonts" | |
}, | |
"icons": { | |
"src": "icons", | |
"dest": "assets/images" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const projectPath = require('blendid/gulpfile.js/lib/projectPath'); | |
module.exports = { | |
images: true, | |
fonts: true, | |
static: true, | |
svgSprite: true, | |
ghPages: false, | |
html: { | |
dataFile: "_data/global.json", | |
extensions: ["html", "twig", "json", "svg"], | |
excludeFolders: ["_layouts", "_partials", "_macros", "_data"], | |
templateLanguage: "twig", | |
twig: { | |
errorLogToConsole: true, | |
}, | |
dataFunction: function(file) { | |
const dataPath = projectPath(PATH_CONFIG.src, PATH_CONFIG.html.src, TASK_CONFIG.html.dataFile) | |
const data = JSON.parse(fs.readFileSync(dataPath, 'utf8')) | |
return { | |
'isDev': !global.production, | |
...data | |
} | |
} | |
}, | |
stylesheets: { | |
autoprefixer: { | |
grid: true | |
} | |
}, | |
javascripts: { | |
entry: { | |
// files paths are relative to | |
// javascripts.dest in path-config.json | |
app: ["./app.js"] | |
}, | |
provide: { | |
$: "jquery", | |
jQuery: "jquery", | |
"window.jQuery": "jquery" | |
} | |
}, | |
browserSync: { | |
server: { | |
// should match `dest` in | |
// path-config.json | |
baseDir: 'public' | |
} | |
}, | |
production: { | |
rev: false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment