Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

fake-style-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fake-style-loader

Like style-loader in modules mode, but can be used on server

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

fake-style-loader

This works similar to style-loader, except it can be used on the server.

Usage

// in webpack config loaders, for server bundle
{ test: /\.css$/, loader: 'fake-style!css?modules' },

// in webpack config loaders, for client bundle (unrelated to this plugin)
{ test: /\.css$/, loader: 'style!css?modules' },
var styles = require('./some-file.css')

console.log(styles)
// returns
// {
//   heading: '.XYZABC123',
//   ...
//   source: '.heading { color: blue; }'
// }

The classnames are returned, just like when using the style-loader and the css-loader in modules mode. As an added bonus the returned object contains a source property which contains the CSS source code after it has went through css-loader. As an example, this css source can be inlined into the HTML response on the server.

Keywords

webpack

FAQs

Package last updated on 09 Apr 2016

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