Coder Social home page Coder Social logo

betty's Introduction

BETTY

v2.0

Cheeky little task runner.

Config

A config.js file is required to set the project source and export paths required for the tasks detailed below. The config file should be placed in the 'gulp' folder. An example of this file can be seen below.

Remember to include your Project Folder as the baseName and add your fonts to fontUrl e.g. https://fonts.googleapis.com/css2?family=Rubik:wght@400;700&display=swap

const baseName = '';

module.exports = {
    app: { name: `${baseName}`},
    css: {
        sourcePaths: [
            `../${baseName}/src/scss/**/*.scss`,
        ],
        exportPath: `../${baseName}/marketplace_builder/assets/css/`
    },
    scripts: {
        sourcePaths: [
            `../${baseName}/src/js/**/*.js`,
        ],
        exportPath: `../${baseName}/marketplace_builder/assets/js/`
    },
    images: {
        sourcePaths: [
            `../${baseName}/src/images/**/*`,
        ],
        exportPath: `../${baseName}/marketplace_builder/assets/images/`
    },
    fonts: {
        exportPath: `../${baseName}/marketplace_builder/assets/fonts/`,
        fontUrl: ``
    }
};

Tasks

Fonts

$ gulp fonts

This task will download fonts from google fonts and produce a fonts stylesheet which can be applied to a web page after load. This improves performance because we can serve the fonts locally.

Example usage for loading after content:

<link rel="stylesheet" media="print" href="{{ '/fonts/fonts.css' | asset_url }}" onload="this.media='all'" />


Images

$ gulp images

This task will take any compare images from the src folder with the assets folder based on last modification date. If an image in src is newer it will optimise the image and send it to the assets folder.


Sass

$ gulp sass

This task compiles and minifies sass from the src folder into css in the assets folder. When the production flag is set to false the files will include source maps.


Scripts

$ gulp scripts

This task will take javascript files from src/js, minify them if they are not already minified and move into the assets folder. The task will not modify any files which come under src/js/vendor, it will move them directly into the assets.


Watcher

$ gulp watch

This task runs images, sass and scripts when changes are made in the respective source folders.

betty's People

Contributors

peterwilmshurst avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.