0.1.1 • Published 7 years ago

educator v0.1.1

Weekly downloads
3
License
-
Repository
-
Last release
7 years ago

#How to use

Clone this repo and then in command line type:

  • npm install - install all dependencies
  • gulp - run dev-server and let magic happen, or
  • gulp build - build project from sources

--

List of Gulp tasks

To run separate task type in command line gulp [task_name]. Almost all tasks also have watch mode - gulp [task_name]:watch, but you don't need to use it directly.

Main tasks

Task nameDescription
defaultwill start all tasks required by project in dev mode: initial build, watch files, run server with livereload
build:devbuild dev version of project (without code optimizations)
buildbuild production-ready project (with code optimizations)

Other tasks

Task nameDescription
sasscompile .sass/.scss to .css. We also use postcss for autoprefixer, so feel free to include other awesome postcss plugins when needed
webpackcompile .js sources into bundle file
copycopy common files from ./src path to ./dist path
swigcompile swig templates
nunjuckscompile Mozilla's awesome nunjucks templates
jadecompile jade templates
svgooptimize svg files with svgo
iconfontcompile iconfonts from svg sources
sprite:svgcreate svg symbol sprites (css-tricks)
sprite:pngcreate png sprites
serverrun dev-server powered by BrowserSync
cleanremove ./dist folder
index-pagecreate index file with links to all project pages

This is a full list of tasks, that we use in our projects, but not all of them should be available in current project. For example, we only use one template engine out of these three jade, nunjucks, swig. All available tasks are placed in a folder ./gulp/tasks as separate *.js files. Usually, file name = task name.

Flags

We have several useful flags.

  • gulp --open or gulp server --open - run dev server and then open preview in browser
  • gulp --tunnel=[name] or gulp server --tunnel [name] - runs dev server and allows you to easily share a web service on your local development machine (powered by localtunnel.me). Your local site will be available at [name].localtunnel.me.
  • gulp [task_name] --prod or gulp [task_name] --production - run task in production mode. Some of the tasks (like, sass or js compilation) have additional settings for production mode (such as code minification), so with this flag you can force production mode. gulp build uses this mode by default.

##Other You can also use npm scripts:

  • npm run ghpages to push only ./dist folder to gh-pages branch on github (very useful for previews).
  • npm run start - same as gulp default.
  • npm run build - same as gulp build.