svelte-preprocess
Advanced tools
Comparing version 2.2.0 to 2.2.1
{ | ||
"name": "svelte-preprocess", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -16,6 +16,12 @@ const postcss = require('postcss') | ||
/** Adapted from https://github.com/TehShrike/svelte-preprocess-postcss */ | ||
module.exports = ({ content, filename, options = {}, map = false }) => { | ||
return postcssLoadConfig(options, options.configFilePath) | ||
.then(options => process(options.plugins || [], content, filename, map)) | ||
.catch(e => process(options.plugins || [], content, filename, map)) | ||
module.exports = ({ content, filename, options = {}, map = undefined }) => { | ||
console.log({ content, map }) | ||
/** If manually passed a plugins array, use it as the postcss config */ | ||
return typeof options.plugins !== 'undefined' | ||
? process(options.plugins || [], content, filename, map) | ||
: /** If not, look for a postcss config file */ | ||
postcssLoadConfig(options, options.configFilePath) | ||
.then(options => process(options.plugins || [], content, filename, map)) | ||
/** No config object passed and no config file found, do nothing */ | ||
.catch(e => ({ code: content, map })) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18390
293