rollup-plugin-postcss
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -19,5 +19,6 @@ 'use strict'; | ||
var filter = rollupPluginutils.createFilter(options.include, options.exclude); | ||
var injectFnName = '__$styleInject'; | ||
return { | ||
intro: function intro() { | ||
return styleInject.toString(); | ||
return styleInject.toString().replace(/styleInject/, injectFnName); | ||
}, | ||
@@ -37,3 +38,3 @@ transform: function transform(code, id) { | ||
code = postcss(options.plugins || []).process(code, opts).css; | ||
code = 'export default styleInject(' + JSON.stringify(code) + ');'; | ||
code = 'export default ' + injectFnName + '(' + JSON.stringify(code) + ');'; | ||
return { | ||
@@ -40,0 +41,0 @@ code: code, |
{ | ||
"name": "rollup-plugin-postcss", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Seamless integration between Rollup and PostCSS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ # 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) | ||
Seamless integration between Rollup and PostCSS. | ||
Seamless integration between [Rollup](https://github.com/rollup/rollup) and [PostCSS](https://github.com/postcss/postcss). | ||
@@ -18,3 +18,3 @@ ## Installation | ||
**rollup.config.js** | ||
**config** | ||
@@ -21,0 +21,0 @@ ```javascript |
@@ -12,5 +12,6 @@ import { createFilter } from 'rollup-pluginutils'; | ||
const filter = createFilter( options.include, options.exclude ); | ||
const injectFnName = '__$styleInject' | ||
return { | ||
intro () { | ||
return styleInject.toString(); | ||
return styleInject.toString().replace(/styleInject/, injectFnName); | ||
}, | ||
@@ -30,3 +31,3 @@ transform (code, id) { | ||
code = postcss(options.plugins || []).process(code, opts).css; | ||
code = `export default styleInject(${JSON.stringify(code)});` | ||
code = `export default ${injectFnName}(${JSON.stringify(code)});` | ||
return { | ||
@@ -33,0 +34,0 @@ code, |
5922
87