From 35047445feb491f59057191f77fc49b78c3db0bf Mon Sep 17 00:00:00 2001 From: Marc Porciuncula Date: Thu, 28 Dec 2017 02:05:32 +1100 Subject: [PATCH] Expose sourceFileName to plugins --- readme.md | 1 + src/_utils.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index d6ffc082..9a201fc1 100644 --- a/readme.md +++ b/readme.md @@ -553,6 +553,7 @@ The `options` object has the following shape: vendorPrefixes: boolean, isGlobal: boolean, filename: ?string, // defined only when styled-jsx/babel is used via Babel CLI, + sourceFileName: string, // the original Javascript file the CSS block was in location: { // the original location of the CSS block in the JavaScript file start: { line: number, diff --git a/src/_utils.js b/src/_utils.js index 7b6a02ac..0ec5d7d2 100644 --- a/src/_utils.js +++ b/src/_utils.js @@ -524,7 +524,8 @@ export const processCss = (stylesInfo, options) => { vendorPrefixes, sourceMaps: useSourceMaps, isGlobal, - filename: fileInfo.filename + filename: fileInfo.filename, + sourceFileName: fileInfo.sourceFileName } let transformedCss