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

css-as-json-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-as-json-loader

Webpack loader that loads CSS and emits it as JSON (conformant with PostCSS API)

  • 0.2.2-wip.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

css-as-json-loader

Dependency Status devDependency Status

Webpack loader that loads CSS and emits it as JSON

Installation

css-as-json-loader on NPM

Usage

Put css-as-json-loader in as a loader in webpack.config.js. This loader is best combined with json-loader, as this plugin itself does not output a valid javascript module.

// in webpack.config.js
...
loaders: [{
  test: /\.css$/,
  loader: 'json!css-as-json'
}]

Example

path/to/some.css

a, b {
  prop: value;
}
@media screen {
  a {
    prop: other-value;
  }
}

example.js

var css = require('path/to/some.css');

// or ES2015-style
import css from 'path/to/some.css';

//css is now equal to the following:
css == {
  type: 'root',
  origin: {
    source: 'path/to/some.css',

  },
  nodes: []
}

Keywords

FAQs

Package last updated on 01 Mar 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

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