svelte-preprocess
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"name": "svelte-preprocess", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"license": "MIT", | ||
@@ -30,2 +30,3 @@ "main": "src/index.js", | ||
"coffeescript": "^2.3.0", | ||
"cosmiconfig": "^5.0.5", | ||
"eslint": "^4.19.1", | ||
@@ -32,0 +33,0 @@ "eslint-config-prettier": "^2.9.0", |
const postcss = require('postcss') | ||
const { PATHS } = require('../utils.js') | ||
const { existsSync } = require('fs') | ||
const { resolve } = require('path') | ||
const cosmiconfig = require('cosmiconfig') | ||
const postcssConfig = cosmiconfig('postcss').searchSync() | ||
const postcssConfigPath = resolve(PATHS.CWD, 'postcss.config.js') | ||
const hasPostcssConfig = existsSync(postcssConfigPath) | ||
module.exports = ({ content, filename, options, map = false }) => { | ||
/** Try to use postcss.config.js if no config was passed */ | ||
if (!options && hasPostcssConfig) { | ||
options = require(postcssConfigPath) | ||
if (!options && postcssConfig) { | ||
options = require(postcssConfig.filepath) | ||
} | ||
@@ -14,0 +10,0 @@ |
@@ -10,4 +10,2 @@ const { readFileSync } = require('fs') | ||
} | ||
exports.PATHS = PATHS | ||
const LANG_DICT = new Map([ | ||
@@ -14,0 +12,0 @@ ['postcss', 'css'], |
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
4
13549
19
287