svelte-preprocess
Advanced tools
Comparing version 2.1.3 to 2.1.4
{ | ||
"name": "svelte-preprocess", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -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 @@ |
@@ -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, |
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
13890
180