3.1.0 • Published 6 years ago

lynchburg v3.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

Lynchburg

Lynchburg logo

"It’s not a framework, it’s a starting point."

Lynchburg is a collection of Gulp tasks for common frontend development tasks.

  • Compiles and minifies Sass to CSS and includes Autoprefixer and the responsive typography from Rucksack
  • Formats source sass files using CSScomb according to the .csscomb.json configuration file.
  • Bundles JS files using Webpack.
  • Minifies images.
  • Production builds, which removes sourcemaps, minifies output CSS/JS, and compresses images.
  • Watches source files and runs the appropriate tasks when changes are detected.
  • Uses Browsersync to proxy a local server and update browsers when files are updated.

Install

$ npm install lynchburg

or

$ yarn add lynchburg

Prerequisites

  • Node/npm
    • If you're running macOS, the easiest way to download Node is to first install Homebrew, then run brew install node.
    • On Linux, the easiest way is to use nvm.
  • Gulp CLI
    • npm install -g gulp-cli or yarn global add gulp-cli

Basic Usage

Create a gulpfile.js with the options you want to override from the default config. If you're using Bedrock for a WordPress site, your config will probably want to look like this:

const config = {
    src: {
        views: 'web/app/themes/SITE_NAME/**/*.{html,phtml,php,twig}'
    },
    dist: {
        dir: 'web/app/themes/SITE_NAME/dist'
    },
    options: {
        browsersync: {
            proxy: 'SITE_NAME.local'
        }
    }
};

module.exports = require('lynchburg')(config);

You can now use any of Lynchburg's gulp tasks! Run gulp to run the default task and trigger a build, start Browsersync, and start watching files. Pass the --production flag to run in production mode. For example, to do a production build:

$ gulp build --production

You can see all the available tasks and a description of what each one does by running the following command:

$ gulp --tasks

Configuration

Lynchburg can be configured by passing it a config object that overrides any of the keys in the default config object. The passed config will be merged in with the default config, so you needn't redefine any keys you don't need to change.

CSScomb

CSScomb can be disabled by setting config.options.csscomb to false.