Last active
July 18, 2018 17:40
-
-
Save Bamblehorse/20db9a31e2c742af30b09dbe677dc6e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 chokidar = require("chokidar"); | |
const watcher = chokidar | |
.watch("src/components/**", { ignored: /node_modules/ }) | |
.on("addDir", (path, event) => { | |
const name = path.replace(/.*\/components\//, ""); | |
const goodToGo = /^[^\/_]*$/.test(name); | |
if (goodToGo) createFiles(path, name); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment