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

react-with-styles-interface-css-compiler

Package Overview
Dependencies
Maintainers
6
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-with-styles-interface-css-compiler

Build step package for generating a static css file to support a react-with-styles project built with the react-with-styles CSS interface

  • 2.1.0
  • npm
  • Socket score

Version published
Weekly downloads
82
decreased by-29.91%
Maintainers
6
Weekly downloads
 
Created
Source

react-with-styles-interface-css-compiler

Compiler for react-with-styles-interface-css that compiles CSS-in-js styles to generate a static CSS file.

Usage

Compile

The styles passed to withStyles in the source code are compiled to static CSS by the compileCSS function shown below. For convenience, a CLI wrapping compileCSS is provided.

Compile via CLI

Compile styles to CSS using the compile-css CLI.

  • Expects a relative or absolute path to the entry point source file of a React application
  • Automatically compiles the source file and its imported dependencies on the fly using the babel configuration present in the project if one exists
  • Outputs a stylesheet.css file containing the compiled CSS in the current working directory
Run the CLI via npm script (preferred):
{
  "scripts": {
    "build:css": "compile-css src/App.jsx"
  }
}
npm run build:css
Run the CLI directly:
./node_modules/.bin/compile-css src/App.jsx
Compile via library function
import compileCSS from 'react-with-styles-interface-css-compiler';

const entryPointFilePath = 'src/App.jsx';
// CSS is the minified CSS output
const CSS = compileCSS(entryPointFilePath);

Keywords

FAQs

Package last updated on 04 Sep 2019

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