Skip to content

Commit

Permalink
Simplified fixes from giuseppeg#46 and giuseppeg#51
Browse files Browse the repository at this point in the history
  • Loading branch information
johncomposed committed Dec 16, 2021
1 parent 9424514 commit cf1827a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ module.exports = function processor(src, options) {

const loaderPromise = loaderPromises.hasOwnProperty(options.path || 'auto')
? loaderPromises[options.path || 'auto']
: loader(options.env || process.env, options.path, {
: loader({env: options.env || process.env, ...(options.pluginOptions||{})}, options.path, {
argv: false
}).then((pluginsInfo) => pluginsInfo.plugins || [])

loaderPromises[options.path || 'auto'] = loaderPromise

return loaderPromise
.then((plugins) => postcss(plugins).process(src, { from: false }))
.then((plugins) => postcss(plugins).process(src, {
from: (options.babel || {}).filename || "unknown filename",
...(options.processOptions || {})
}))
.then((result) => result.css)
}

0 comments on commit cf1827a

Please sign in to comment.