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.3.4 to 0.3.5

19

index.js

@@ -93,4 +93,5 @@ 'use strict';

CSSModules.prototype.loadPath = function(absolutePath) {
CSSModules.prototype.loadPath = function(dependency) {
var seen = this._seen;
var absolutePath = dependency.toString();
if (seen[absolutePath]) {

@@ -101,3 +102,3 @@ return Promise.resolve(seen[absolutePath]);

var content = fs.readFileSync(absolutePath, this.encoding);
return this.load(content, absolutePath, this.fetchExports.bind(this)).then(function(result) {
return this.load(content, dependency, this.fetchExports.bind(this)).then(function(result) {
return (seen[absolutePath] = result);

@@ -107,13 +108,13 @@ });

CSSModules.prototype.generateRelativeScopedName = function(className, absolutePath, fullRule) {
CSSModules.prototype.generateRelativeScopedName = function(dependency, className, absolutePath, fullRule) {
var relativePath = absolutePath.replace(this.inputPaths[0] + '/', '');
return this.generateScopedName(className, relativePath, fullRule);
return this.generateScopedName(className, relativePath, fullRule, dependency);
};
CSSModules.prototype.load = function(content, contentPath, pathFetcher) {
CSSModules.prototype.load = function(content, dependency, pathFetcher) {
var parser = new ModulesParser(pathFetcher);
var options = this.processorOptions({ from: '/' + contentPath });
var options = this.processorOptions({ from: '/' + dependency });
var processor = postcss([]
.concat(this.plugins.before)
.concat(this.loaderPlugins())
.concat(this.loaderPlugins(dependency))
.concat([parser.plugin])

@@ -131,3 +132,3 @@ .concat(this.plugins.after));

CSSModules.prototype.loaderPlugins = function() {
CSSModules.prototype.loaderPlugins = function(dependency) {
return [

@@ -139,3 +140,3 @@ LoaderCore.values,

LoaderCore.scope({
generateScopedName: this.generateRelativeScopedName.bind(this)
generateScopedName: this.generateRelativeScopedName.bind(this, dependency)
})

@@ -142,0 +143,0 @@ ];

{
"name": "broccoli-css-modules",
"version": "0.3.4",
"version": "0.3.5",
"description": "A broccoli plugin for compiling CSS modules",

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

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