svelte-preprocess
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "svelte-preprocess", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"license": "MIT", | ||
@@ -22,2 +22,3 @@ "main": "src/index.js", | ||
"test:watch": "jest --no-cache --verbose --watchAll", | ||
"release": "npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish", | ||
"prepublishOnly": "npm run test" | ||
@@ -44,3 +45,3 @@ }, | ||
"peerDependencies": { | ||
"svelte": "^1.44.0" | ||
"svelte": "^1.44.0 || ^2.0.0" | ||
}, | ||
@@ -47,0 +48,0 @@ "optionalPeerDependencies": { |
@@ -7,8 +7,19 @@ # Svelte (Magical) Preprocess | ||
### Basic | ||
```js | ||
const svelte = require('svelte') | ||
const magicalPreprocess = require('svelte-preprocess') | ||
svelte.preprocess(input, magicalPreprocess()).then(...) | ||
``` | ||
### Advanced | ||
```js | ||
const svelte = require('svelte') | ||
const magicalPreprocess = require('svelte-preprocess') | ||
const magicOpts = { | ||
/** Transform the whole markup before preprocessing */ | ||
onBefore({ content,filename }) { | ||
onBefore({ content, filename }) { | ||
return content.replace('something', 'someotherthing') | ||
@@ -47,3 +58,3 @@ }, | ||
* <... lang="cst"> or | ||
* <... type="text/cst"> | ||
* <... type="text/customLanguage"> | ||
* will be treated as the language 'customLanguage' | ||
@@ -85,8 +96,22 @@ */ | ||
```html | ||
<div>Hey</div> | ||
<template lang="pug"> | ||
div Hey | ||
</template> | ||
<script type="text/coffeescript"> | ||
export default | ||
methods: | ||
foo: () -> | ||
console.log('Hey') | ||
</script> | ||
<style src="./style.scss"></style> | ||
<!-- Or --> | ||
<style src="./style.styl"></style> | ||
<!-- Or --> | ||
<style lang="scss"> | ||
@@ -99,2 +124,4 @@ $color: red; | ||
<!-- Or --> | ||
<style type="text/stylus"> | ||
@@ -101,0 +128,0 @@ $color = red |
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
11314
129