diff --git a/plugins/plugin-postcss/plugin.js b/plugins/plugin-postcss/plugin.js index 366142aaee..2cc6958e9b 100644 --- a/plugins/plugin-postcss/plugin.js +++ b/plugins/plugin-postcss/plugin.js @@ -1,10 +1,9 @@ -const path = require('path'); const execa = require('execa'); module.exports = function postcssPlugin(_, options) { return { name: '@snowpack/postcss-transform', - async transform({id, fileExt, contents}) { + async transform({fileExt, contents}) { const {input = ['.css'], config} = options; if (!input.includes(fileExt) || !contents) return; @@ -12,7 +11,7 @@ module.exports = function postcssPlugin(_, options) { if (config) flags.push(`--config ${config}`); const {stdout} = await execa('postcss', flags, { - cwd: path.dirname(id), + cwd: process.cwd(), input: contents, });