Front-end workflow with Gulp , BrowserSync , Pug , PostCSS , Browserify
PostCSS Plugins: cssnext , lost , import , reporter , rucksack , postcss-mixins , postcss-nested
- Install Node.js (for your platform).
- run
npm install --g gulp browser-sync browserify.
git clone https://github.com/xowei/frontend-workflow.git
Install dependencies npm install
src folder is sources code : contains Pug, PostCSS, Javascript, Javascript modules, fonts, images etc.
dist folder is for public : contains HTML, CSS, javascript, fonts, compressed images etc.
-
gulpornpm run dev: Start dev mode server. Local view: http://127.0.0.1:3000/ -
gulp --productionornpm start: run all the tasks. Compressed html, css and js and open server -
gulp build --productionornpm run buildrun all the tasks. Compressed html, css and js without open server
gulp pugCompile Pug to HTMLgulp cssCompile PostCSS to single CSS file named 'styles.css'gulp jsCompile script.js with browserify to single javascript file named 'scripts.js'gulp assetscopy fonts and compressed imagesgulp,npm startrun all of the above task and open browser-sync server using production modegulp delremove dist folder