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

css-js-loader

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-js-loader - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

internal/CSSProperty.js

24

index.js

@@ -8,3 +8,3 @@ var defaults = require('lodash/defaults');

var loaderUtils = require('loader-utils');
var dangerousStyleValue = require('react-dom/lib/dangerousStyleValue');
var dangerousStyleValue = require('./internal/dangerousStyleValue');
var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');

@@ -14,7 +14,7 @@

return pretty ? Array(depth).join(' ') : '';
};
}
function space(pretty) {
return pretty ? ' ' : '';
};
}

@@ -49,3 +49,5 @@ function line(pretty) {

css += indent(pretty, indentLevel) + hyphenateStyleName(name) + ':' + space(pretty);
css += indent(pretty, indentLevel) +
hyphenateStyleName(name) + ':' +
space(pretty);
css += dangerousStyleValue(name, value) + ';' + line(pretty);

@@ -60,3 +62,4 @@ } else {

// block to the markup.
css += indent(pretty, indentLevel) + name + space(pretty) + '{' + line(pretty);
css += indent(pretty, indentLevel) + name + space(pretty) + '{' +
line(pretty);
indentLevel += 1;

@@ -98,11 +101,10 @@ }

config = defaults(
loaderUtils.getLoaderConfig(this, 'jsCssLoader'),
var config = defaults(
loaderUtils.getOptions(this),
{pretty: process.env.NODE_ENV !== 'production'}
);
var styles = this.exec(content, this.resourcePath);
var styles = typeof content === 'object' ? content :
this.exec(content, this.resourcePath);
var css = '';
if (styles.__esModule) {

@@ -131,3 +133,3 @@ // When using Babel, css classes can be defined as named es6 exports.

omit(styles, 'default'),
function (value, key) {
function(value, key) {
return '.' + key;

@@ -134,0 +136,0 @@ }

{
"name": "css-js-loader",
"version": "0.4.0",
"version": "0.4.1",
"description": "",
"main": "index.js",
"repository": "metalabdesign/css-js-loader",
"scripts": {

@@ -13,16 +14,10 @@ "test": "npm run lint",

"dependencies": {
"fbjs": "^0.8.8",
"loader-utils": "^0.2.16",
"lodash": "^4.17.4",
"react-dom": "^15.4.2"
"fbjs": "^0.8.16",
"loader-utils": "^1.1.0",
"lodash": "^4.17.4"
},
"devDependencies": {
"eslint": "^2.10.2",
"eslint-config-metalab": "^4.0.1",
"eslint-import-resolver-babel-module": "^2.0.1",
"eslint-plugin-filenames": "^0.2.0",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-lodash-fp": "^1.2.0",
"eslint-plugin-react": "^5.1.1"
"eslint": "^4.9.0",
"eslint-config-metalab": "^7.0.1"
}
}

@@ -16,3 +16,3 @@ # css-js-loader

```sh
yarn add css-js-loader
npm install css-js-loader value-loader
```

@@ -31,3 +31,3 @@

test: /\.css\.js$/,
loader: 'css-js-loader',
loaders: ['css-js-loader', 'value-loader'],
}],

@@ -38,5 +38,7 @@ },

NOTE: You don't need to chain with [value-loader] per-se, but doing so gives you caching, nested dependency monitoring/reloading and the ability to use webpack's tree-shaking abilities.
## Writing JS Styles
`css-js-loader` converts JS modules to CSS markup at runtime.
`css-js-loader` converts JS modules to CSS markup at runtime.

@@ -110,1 +112,2 @@ A `.css.js` file:

[CSS Modules]: https://github.com/webpack-contrib/css-loader#css-modules
[value-loader]: https://www.npmjs.com/package/value-loader

@@ -0,1 +1,2 @@

/* global __WRAPPED__ __CONTEXT__ __IDENT_NAME__ */
var Module = require('module');

@@ -2,0 +3,0 @@

/* eslint-disable guard-for-in */
var path = require('path');
var getLocalIdent = require('css-loader/lib/getLocalIdent');

@@ -5,0 +4,0 @@

Sorry, the diff of this file is not supported yet

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