A jekyll-based build process that optimizes scripts, styles, and images using GULP.
- Concats and minimizes JavaScript files
- Compiles SASS
- Autoprefixes styles
- Concats CSS files
- Compiles jekyll projects
- Allows splitting of vendor files and personal files for concatination (helps reduce site-download times)
- NodeJs
- Gulp
- Ruby/RubyGems
- Jekyll
- Create a project folder, this will be the root folder for the project
- Place gulpfile.js and package.json in the root folder
- Create a folder called "app" in the root folder, this will be where the source code for the project goes
- Setup jekyll in the app folder
- Run gulp in the root directory
To use JavaScript create a folder "_js" in the app directory. In here is where all your personal JS files that you want to optimize will go. For vendor scripts, in this folder create a subfolder "vendors" and place all vendor scripts in here. Vendor scripts and personal scripts will be optimized seperately and must be included seperately.
To use optimized scripts add the following two lines:
<script type="text/javascript" src="/js/vendors.min.js"></script>
<script type="text/javascript" src="/js/scripts.min.js"></script>
For best results add these to your footer as this will prevent rendor-blocking code.
To use CSS create a folder "_css" in the app directory. Here is where all your personal CSS files will be placed. For vendor styles create a subfolder called "vendors" and place them there. This is because vendor styles and personal styles will be optimized seperately.
To use the optimized stylesheets use the following lines:
<link rel="stylesheet" type="text/css" href="/css/vendors.min.css">
<link rel="stylesheet" type="text/css" href="/css/styles.min.css">
Create a "css" or "js" folder in your app directory and place your files in the respective folders. To use them add them as you would any other style/script. Files in these directories will not be touched by the build process and will simply be coppied to the dist folder.