rollup-plugin-postcss
Advanced tools
Comparing version 0.0.1 to 0.0.11
16
index.js
@@ -7,3 +7,9 @@ 'use strict'; | ||
styleInject = 'default' in styleInject ? styleInject['default'] : styleInject; | ||
var path = require('path'); | ||
path = 'default' in path ? path['default'] : path; | ||
function pathJoin(file) { | ||
return path.join(process.cwd(), file); | ||
} | ||
function index () { | ||
@@ -20,3 +26,11 @@ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
} | ||
code = postcss(options.plugins || []).process(code).css; | ||
var opts = { | ||
from: options.from ? pathJoin(options.from) : id, | ||
to: options.to ? pathJoin(options.to) : id, | ||
map: { | ||
inline: false, | ||
annotation: false | ||
} | ||
}; | ||
code = postcss(options.plugins || []).process(code, opts).css; | ||
code = 'export default styleInject(' + JSON.stringify(code) + ');'; | ||
@@ -23,0 +37,0 @@ return { |
{ | ||
"name": "rollup-plugin-postcss", | ||
"version": "0.0.1", | ||
"version": "0.0.11", | ||
"description": "Seamless integration between Rollup and PostCSS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
## rollup-plugin-postcss | ||
# rollup-plugin-postcss [![Build Status](https://img.shields.io/circleci/project/egoist/rollup-plugin-postcss/master.svg?style=flat-square)](https://circleci.com/gh/egoist/rollup-plugin-postcss/tree/master) | ||
@@ -3,0 +3,0 @@ Seamless integration between Rollup and PostCSS. |
import babel from 'rollup-plugin-babel'; | ||
const external = Object.keys( require( './package.json' ).dependencies ) ; | ||
var external = Object.keys( require( './package.json' ).dependencies ); | ||
@@ -5,0 +5,0 @@ export default { |
import postcss from 'postcss'; | ||
import styleInject from 'style-inject'; | ||
import path from 'path'; | ||
function pathJoin (file) { | ||
return path.join(process.cwd(), file); | ||
} | ||
export default function (options = {}) { | ||
@@ -13,3 +18,11 @@ return { | ||
} | ||
code = postcss(options.plugins || []).process(code).css; | ||
const opts = { | ||
from: options.from ? pathJoin(options.from) : id, | ||
to: options.to ? pathJoin(options.to) : id, | ||
map: { | ||
inline: false, | ||
annotation: false | ||
} | ||
}; | ||
code = postcss(options.plugins || []).process(code, opts).css; | ||
code = `export default styleInject(${JSON.stringify(code)});` | ||
@@ -16,0 +29,0 @@ return { |
Sorry, the diff of this file is not supported yet
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
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
5189
8
81