Created
July 14, 2021 04:35
-
-
Save jaju/c3da5d745231b07e96774e1a3eedc7b5 to your computer and use it in GitHub Desktop.
Gulp snippets
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
// Copy static resources from your node modules - CSS files, font files etc. | |
let publicDir = "resources/public"; | |
const copyStatics = async () => { | |
var katex = { | |
"css/fonts": {"pattern": "katex/dist/fonts/**/*"}, | |
"css": {"pattern": "katex/dist/**/*.min.css"} | |
} | |
var normalize = { | |
"css": {"pattern": "normalize.css/normalize\.css"} | |
} | |
var groups = [katex, normalize]; | |
groups.forEach((group) => { | |
for (let kind in group) { | |
gulp.src(node_modules + "/" + group[kind].pattern) | |
.pipe(gulp.dest(publicDir + "/" + kind)); | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment