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

broccoli-css-modules

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-css-modules - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

22

index.js

@@ -38,2 +38,4 @@ 'use strict';

this.formatCSS = options.formatCSS;
this.enableSourceMaps = options.enableSourceMaps;
this.sourceMapBaseDir = options.sourceMapBaseDir;
this.postcssOptions = options.postcssOptions || {};

@@ -102,2 +104,4 @@ this.virtualModules = options.virtualModules || Object.create(null);

return this.formatCSS(injectableSource, modulePath);
} else if (this.enableSourceMaps) {
return injectableSource;
} else {

@@ -145,3 +149,7 @@ return '/* styles for ' + modulePath + ' */\n' + injectableSource;

CSSModules.prototype.load = function(content, dependency) {
var options = this.processorOptions({ from: dependency.toString() });
var options = this.processorOptions({
from: dependency.toString(),
map: this.sourceMapOptions(dependency)
});
var processor = postcss([]

@@ -161,2 +169,14 @@ .concat(this.plugins.before)

CSSModules.prototype.sourceMapOptions = function(dependency) {
if (!this.enableSourceMaps) return;
var dir = this.sourceMapBaseDir ? ('/' + ensurePosixPath(this.sourceMapBaseDir)) : '';
return {
inline: true,
sourcesContent: true,
annotation: this.posixInputPath() + dir + '/output.map'
};
};
CSSModules.prototype.loaderPlugins = function(dependency) {

@@ -163,0 +183,0 @@ return [

2

package.json
{
"name": "broccoli-css-modules",
"version": "0.5.1",
"version": "0.5.2",
"description": "A broccoli plugin for compiling CSS modules",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -76,2 +76,8 @@ # broccoli-css-modules [![Build Status](https://travis-ci.org/salsify/broccoli-css-modules.svg?branch=master)](https://travis-ci.org/salsify/broccoli-css-modules) [![Window Build Status](https://ci.appveyor.com/api/projects/status/github/salsify/broccoli-css-modules?svg=true)](https://ci.appveyor.com/project/dfreeman97827/broccoli-css-modules)

#### `enableSourceMaps`
Whether inline source maps should be generated for the transformed module CSS.
#### `sourceMapBaseDir`
The base directory relative to which paths in source maps should be encoded. Defaults to the base of the input tree.
##### `postcssOptions`

@@ -78,0 +84,0 @@ A hash of options that will be passed directly through to the PostCSS processor. This allows the use of e.g. custom syntax in the processed files.

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