svelte-preprocess
Advanced tools
Comparing version 2.1.4 to 2.2.0
{ | ||
"name": "svelte-preprocess", | ||
"version": "2.1.4", | ||
"version": "2.2.0", | ||
"license": "MIT", | ||
@@ -59,5 +59,5 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"cosmiconfig": "^5.0.5", | ||
"postcss-load-config": "^2.0.0", | ||
"strip-indent": "^2.0.0" | ||
} | ||
} |
const postcss = require('postcss') | ||
const cosmiconfig = require('cosmiconfig') | ||
const postcssConfig = cosmiconfig('postcss').searchSync() | ||
const postcssLoadConfig = require(`postcss-load-config`) | ||
module.exports = ({ content, filename, options, map = false }) => { | ||
/** Try to use postcss.config.js if no config was passed */ | ||
if (!options && postcssConfig) { | ||
options = require(postcssConfig.filepath) | ||
} | ||
return postcss(options.plugins || options.use || []) | ||
const process = (plugins, content, filename, map) => | ||
postcss(plugins) | ||
.process(content, { | ||
@@ -20,2 +14,8 @@ from: filename, | ||
})) | ||
/** 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)) | ||
} |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
18068
12
+ Addedpostcss-load-config@^2.0.0
+ Addedimport-cwd@2.1.0(transitive)
+ Addedimport-from@2.1.0(transitive)
+ Addedpostcss-load-config@2.1.2(transitive)
- Removedcosmiconfig@^5.0.5