svelte-preprocess
Advanced tools
+1
-1
| { | ||
| "name": "svelte-preprocess", | ||
| "version": "2.1.3", | ||
| "version": "2.1.4", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
+27
-4
@@ -24,5 +24,5 @@ # Svelte Preprocess | ||
| const svelte = require('svelte') | ||
| const getSveltePreprocessor = require('svelte-preprocess') | ||
| const preprocess = require('svelte-preprocess') | ||
| svelte.preprocess(input, getSveltePreprocessor()).then(...) | ||
| svelte.preprocess(input, preprocess({ /* options */ })).then(...) | ||
| ``` | ||
@@ -34,3 +34,3 @@ | ||
| const svelte = require('svelte') | ||
| const getSveltePreprocessor = require('svelte-preprocess') | ||
| const preprocess = require('svelte-preprocess') | ||
| const options = { | ||
@@ -93,5 +93,28 @@ /** Transform the whole markup before preprocessing */ | ||
| svelte.preprocess(input, getSveltePreprocessor(options)).then(...) | ||
| svelte.preprocess(input, preprocess(options)).then(...) | ||
| ``` | ||
| ### With `svelte-loader` | ||
| ```js | ||
| ... | ||
| module: { | ||
| rules: [ | ||
| ... | ||
| { | ||
| test: /\.(html|svelte)$/, | ||
| exclude: /node_modules/, | ||
| use: { | ||
| loader: 'svelte-loader', | ||
| options: { | ||
| preprocess: require('svelte-preprocess')({ /* options */ }) | ||
| }, | ||
| }, | ||
| }, | ||
| ... | ||
| ] | ||
| } | ||
| ... | ||
| ``` | ||
| ## Features | ||
@@ -98,0 +121,0 @@ |
+1
-1
@@ -100,3 +100,3 @@ const stripIndent = require('strip-indent') | ||
| return runTransformer('postcss', transformers.postcss, { | ||
| content: code, | ||
| content: stripIndent(code), | ||
| filename: assetInfo.filename, | ||
@@ -103,0 +103,0 @@ map, |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
13890
2.52%180
14.65%