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.
-
gulp
ornpm run dev
: Start dev mode server. Local view: http://127.0.0.1:3000/ -
gulp --production
ornpm start
: run all the tasks. Compressed html, css and js and open server -
gulp build --production
ornpm run build
run all the tasks. Compressed html, css and js without open server
gulp pug
Compile Pug to HTMLgulp css
Compile PostCSS to single CSS file named 'styles.css'gulp js
Compile script.js with browserify to single javascript file named 'scripts.js'gulp assets
copy fonts and compressed imagesgulp
,npm start
run all of the above task and open browser-sync server using production modegulp del
remove dist folder