For example, if I want to make a demo of a front-end page, my most commonly used structure is as follows
frontend |---img/ |---img01.jpg |---css/ |---style1.css |---js/ |---js1.js |---page1.html |---page2.html |---page3.html
So, the structure must be established step by step every time. Or right-click to package.zipas a template.
Every time you want to use it, create a folder and extract.zip. It just doesn’t feel very elegant. .
So what method can be used to abstract the above structure, so that the directory structure can be quickly created with just one command or something?
Create a git project, then git clone
or other projects
Write a script command to execute the action of creating folders and files. (Use BAT under Windows, use Shell script under Linux, and use the fs library of nodeJs to write cross-platform, or you can also use python)
Write your own boilerplate
When digging a new hole, clone and rebuild
.git
, or simply download the zip from githubYou can try http://yeoman.io/
Scaffolding can be developed using gulp-based slush. Link description