All Projects → wizardnet972 → critical-plugin

wizardnet972 / critical-plugin

Licence: MIT license
⚙️ Critical plugin for webpack (https://webpack.js.org/)

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to critical-plugin

Critical
Extract & Inline Critical-path CSS in HTML pages
Stars: ✭ 9,364 (+54982.35%)
Mutual labels:  inline-css, inline-styles, critical-css, critical-path-css, critical-path-styles
inline.js
Live CSS Helpers with Javascript
Stars: ✭ 36 (+111.76%)
Mutual labels:  inline-css, inline-styles
InlineCssParser
A Visual Studio Extension that helps to extract inline styles into a seperate css file.
Stars: ✭ 23 (+35.29%)
Mutual labels:  inline-css, inline-styles
stylenames
A simple JavaScript utility for conditionally joining inline styles together
Stars: ✭ 18 (+5.88%)
Mutual labels:  inline-css, inline-styles
Html Inline Css Webpack Plugin
☄️ A webpack plugin for convert external stylesheet to the embedded stylesheet
Stars: ✭ 48 (+182.35%)
Mutual labels:  inline-styles, webpack4
crittr
High performance critical css extraction with a great configuration abilities
Stars: ✭ 39 (+129.41%)
Mutual labels:  critical-css, critical
dotfiles
Opinionated garbage for your terminal. Gotta get that yolo swag.
Stars: ✭ 37 (+117.65%)
Mutual labels:  plugins
slackotron
A plugin extensible Slack bot.
Stars: ✭ 13 (-23.53%)
Mutual labels:  plugins
Accordion-Shortcodes
A WordPress plugin that adds a few shortcodes to allow for accordion dropdowns.
Stars: ✭ 16 (-5.88%)
Mutual labels:  plugins
build-plugin-template
Template repository to create new Netlify Build plugins.
Stars: ✭ 26 (+52.94%)
Mutual labels:  plugins
marketplace-feedback
This repository is for feedback regarding NativeScript Marketplace. Use the issues system here to submit feature requests, vote for existing ones or report bugs.
Stars: ✭ 16 (-5.88%)
Mutual labels:  plugins
phaser3-typescript-template
A Phaser 3 TypeScript Template
Stars: ✭ 30 (+76.47%)
Mutual labels:  webpack4
website
Kanboard's website
Stars: ✭ 18 (+5.88%)
Mutual labels:  plugins
flutter plugins
Flutter插件集合,好用常用的插件.
Stars: ✭ 22 (+29.41%)
Mutual labels:  plugins
Symfony-4-by-Samples
Symfony 4 by Samples is a personal project in which I will be creating small demos with tutorial in which to learn the symfony framework 4. Each of the samples contains a README.md file that indicates the purpose of the sample plus an step by step guide to reproduce it. Basic topics, login and register form, authentication, webpack encore, sass…
Stars: ✭ 40 (+135.29%)
Mutual labels:  webpack4
toast
Plugin-driven CLI utility for code generation using Go source as IDL
Stars: ✭ 52 (+205.88%)
Mutual labels:  plugins
rust-ts3plugin
Rust bindings to easily create a TeamSpeak3 plugin
Stars: ✭ 13 (-23.53%)
Mutual labels:  plugins
xd-storage-helper
A little helper to make storing key-value-pairs (e.g. settings) for Adobe XD plugins easier.
Stars: ✭ 22 (+29.41%)
Mutual labels:  plugins
java-toolkit
【Released】🛠Java常用的插件API整理以及基于JDK的一些方法封装库,能在不依赖大型框架下快速进行开发(亦可快速用于测试或者脚本类代码编写 - 含数据库相关)。
Stars: ✭ 13 (-23.53%)
Mutual labels:  plugins
gas-typescript-webpack
This is an example of writing Google Apps Script in TypeScript and building with webpack
Stars: ✭ 27 (+58.82%)
Mutual labels:  webpack4

critical-plugin for webpack

Extract your styles from js bundle and inlined the critical styles in your html

npm deps test

Install

$ npm install critical-plugin [--save-dev]

Setup

First, instantiate the plugin with options in your webpack.config:

// webpack.config.js example

var CriticalPlugin = require('critical-plugin');

module.exports = {
  // ...

  plugins: [
    // ... other plugins
    
    new CritialPlugin()
  ]
  // ...
}

Configuration

You must pass a hash of configuration options to the plugin to cause the addition of attributes. List of them you can find in this link

Plese note that, do not use the following options base, html, src, dest, css, folder, because the critical-plugin will do set them for you base on your project.

// webpack.config.js example

var CriticalPlugin = require('critical-plugin');

var criticalOptions = {
    // Inline the generated critical-path CSS
    // - true generates HTML
    // - false generates CSS
    inline: true,

    // Viewport width
    width: 1300,

    // Viewport height
    height: 900,

    // Minify critical-path CSS when inlining
    minify: true,

    // Extract inlined styles from referenced stylesheets
    extract: true,

    // Complete Timeout for Operation
    timeout: 30000,

    // Prefix for asset directory
    pathPrefix: '/MySubfolderDocrot',

    // ignore CSS rules
    ignore: ['font-face',/some-regexp/],

    // overwrite default options
    ignoreOptions: {}
};

module.exports = {
  // ...

  plugins: [
    // ... other plugins
    
    new CritialPlugin({ critical: criticalOptions })
  ]
  // ...
}

Articles

Like critical-plugin?

Support it by giving feedback, contributing or just by 🌟 starring the project!

Follow me twitter to be notified about new releases.

Maintainers


Wizardnet972

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].