rollup-plugin-postcss
Advanced tools
Comparing version 0.1.0 to 0.1.1
14
index.js
@@ -10,3 +10,3 @@ 'use strict'; | ||
function pathJoin(file) { | ||
function cwd(file) { | ||
return path.join(process.cwd(), file); | ||
@@ -20,2 +20,4 @@ } | ||
var injectFnName = '__$styleInject'; | ||
var extensions = options.extensions || ['.css', '.sss']; | ||
return { | ||
@@ -26,9 +28,7 @@ intro: function intro() { | ||
transform: function transform(code, id) { | ||
console.log(filter(id)); | ||
if (!filter(id) || id.slice(-4) !== '.css') { | ||
return null; | ||
} | ||
if (!filter(id)) return null; | ||
if (extensions.indexOf(path.extname(id)) === -1) return null; | ||
var opts = { | ||
from: options.from ? pathJoin(options.from) : id, | ||
to: options.to ? pathJoin(options.to) : id, | ||
from: options.from ? cwd(options.from) : id, | ||
to: options.to ? cwd(options.to) : id, | ||
map: { | ||
@@ -35,0 +35,0 @@ inline: false, |
{ | ||
"name": "rollup-plugin-postcss", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Seamless integration between Rollup and PostCSS", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "ava test.js", | ||
"test": "npm run build && ava test.js", | ||
"build": "rollup -c -o index.js" | ||
@@ -15,0 +15,0 @@ }, |
6328
83