Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postifycss-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postifycss-loader

webpack loader for css purify and deduplicate, remove unused and duplicated css

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

webpack loader for css purify and deduplicate, remove unused and duplicated css


npm install postifycss-loader --save-dev
var PostifyCssPlugin = require('postifycss-loader/plugin');

function makeStyleLoader(isDev, isLocal) {
  let baseLoader = `css?importLoaders=${isDev ? 2 : 3}${isLocal ? '&modules&localIdentName=[name]_[local]_[hash:base64:5]' : ''}!autoprefixer${isDev ? '' : '!postifycss}!sass`;
  let conf =  {
    test: /\.(css|scss)$/,
    loader: isDev ? `style!${baseLoader}` : ExtractTextPlugin.extract('style', baseLoader, extractTextConf)
  };
  conf[isLocal ? 'exclude' : 'include'] = /statics\/libs/;
  return conf;
}

...

{
  entry:
  output:
  resolve:
  module: {
    loaders: [
      makeStyleLoader(false, false),
    ]
  },
  plugins: [new PostifyCssPlugin({})]
}


new PostifyCssPlugin(options)

  • staticContent // String|Array [optional], absolute path of html or js files, contents will be concated and passed along to purifycss(contents,..);

  • override // boolean [optional], whether to override the output bundle css file, default false.

      `true` => emit the purified and deduplicated css file
    
      `false` => emit (the purified file) and (the purified & deduplicated file with suffixed filename)
    
  • suffix // string [optional], if override!==true, use this as the emited postified css filename suffix, default .pf;

case: 192kb -> 33kb

Keywords

FAQs

Package last updated on 10 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc