Socket
Socket
Sign inDemoInstall

svelte-preprocess

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-preprocess - npm Package Compare versions

Comparing version 2.1.4 to 2.2.0

CHANGELOG.md

4

package.json
{
"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))
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc