babel-plugin-csjs-postcss
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -26,3 +26,6 @@ 'use strict'; | ||
var plugins = state.opts.plugins || []; | ||
var pluginsOpts = state.opts.plugins || []; | ||
var plugins = pluginsOpts.map(handlePlugin); | ||
var processed = postcss(plugins).process(css, { parser: safe, from: this.file.opts.filename }).css; | ||
@@ -48,2 +51,12 @@ | ||
function handlePlugin(pluginArg) { | ||
if (Array.isArray(pluginArg)) { | ||
return require(pluginArg[0]).apply(null, pluginArg.slice(1)); | ||
} else if (typeof pluginArg === 'string') { | ||
return require(pluginArg); | ||
} else { | ||
return pluginArg; | ||
} | ||
} | ||
function expressionPlaceholder(i) { | ||
@@ -50,0 +63,0 @@ return '___QUASI_EXPR_' + i + '___'; |
{ | ||
"name": "babel-plugin-csjs-postcss", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Babel plugin for running postcss on csjs", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# babel-plugin-csjs-postcss | ||
[![build status][build-badge]][build-href] | ||
[![dependencies status][deps-badge]][deps-href] | ||
Babel plugin for running postcss on csjs | ||
[build-badge]: https://travis-ci.org/rtsao/babel-plugin-csjs-postcss.svg?branch=master | ||
[build-href]: https://travis-ci.org/rtsao/babel-plugin-csjs-postcss | ||
[deps-badge]: https://david-dm.org/rtsao/babel-plugin-csjs-postcss.svg | ||
[deps-href]: https://david-dm.org/rtsao/babel-plugin-csjs-postcss |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5613
75
12
3