Giter VIP home page Giter VIP logo

aviate's Introduction

Aviate

Small WebPack based SCSS / Javascript compiler

Installation

Install the package

npm install --save aviate

Open package.json and add:

{
    "scripts": {
        "dev": "aviate",
        "build": "aviate build"
    }
}

Create the aviate.config.js

Configuration file

Aviate is configured using the aviate.config.js file at the root of your project.

const path = require('path')

module.exports = {
    // Defaults to http://localhost:8080 when not provided
    host: 'http://localhost:8080/',
    // Location to copy production assets to (usually one directory)
    distLocations: [
        path.join(__dirname, 'your/production/assets/directory')
    ],
    // Optional location of svgs to create a SVG sprite map. Can also be an object with configuration options for https://github.com/freshheads/svg-spritemap-webpack-plugin
    svgSprite: '**/*.svg',
    // Entirely optional if you don't have any custom postcss plugins
    // This example shows how to add css-mqpacker
    postCss(loader, defaultPlugins) {
        // Optional possibility to disable default postCSS plugins        
        const plugins = defaultPlugins({
            // 'autoprefixer': true,
            // 'lost': true,
            // 'postcss-custom-media': true,
            // 'postcss-zindex': true,
            // 'postcss-discard-duplicates': true,
            // 'postcss-unique-selectors': true,
            // 'postcss-responsive-type': true
        })

        plugins.push(require('css-mqpacker')())

        return plugins
    }
    // Allows you to define custom WebPack properties
    // `config` is a WebPack config object
    // `config.entry` is required
    // Entries will be compiled to `http://localhost:8080/<entrykey>` in development
    // In production the entries will be copied to `distLocations`
    decorateConfig(config) {
        config.entry = Object.assign({}, config.entry, {
            // When using scss that never changes (external dependencies) should be added to the array to greatly improve compilation time
            'styles': [
                path.join(__dirname, 'web/app/themes/wecustom/assets/styles/main.scss')
            ],
            // All javascript goes through Babel. So you can write es2015 (ES6) code. It also includes all requirements for compiling React applications
            'javascript': [
                path.join(__dirname, 'web/app/themes/wecustom/assets/javascript/main.js')
            ],
        })

        return config
    }
}

PostCSS plugins

These plugins are included by default:

aviate's People

Contributors

timneutkens avatar

Stargazers

 avatar

Watchers

 avatar  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.