Git Product home page Git Product logo

critical2partial's Introduction

critical2partial (critical-tool)

Tool for create critical html partials

Install

npm i bolighed-critical2partial -D

Example

critical.config.js

const path = require('path');

module.exports = config = {
    parallel_tabs: 4,
    browser_args: [
        // '--disable-gpu',
        // `--window-size=${ resolution.x },${ resolution.y }`,
        '--no-sandbox',
    ],
    files: [{
        critical_options: {
            base: path.join(__dirname, '../../../backend'),
            folder: 'assets',
            ignore: [
                "@font-face"
            ],
            width: 1300,
            height: 900,
            minify: true
        },
        static_file: 'http://localhost:18000/bolig/aarhus-c/8000/thorvaldsensgade/1/1/th/sundhed',
        output_file: '../../../backend/home/templates/home/critical.home.html'
    }]
}

critical_options are the options of the critical npm module. static_file could also be a url, if so it will the file will be fetched from remote.

Use from CLI

bolighed-critical2partial -c ./example.config.js 

Use programmatically

index.js

const config = require('./critical.config');
const c2p = require('bolighed-critical2partial')(config);

critical2partial's People

Contributors

pmcalabrese avatar kildevaeld avatar

Watchers

Thomas Ammitzbøll-Bach avatar James Cloos avatar  avatar ab avatar  avatar  avatar Pyconsult.dk avatar John Parayno avatar Alexander Rothschild avatar Simon Lyngby Kokkendorff avatar Jonas Nygaard Pedersen 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.