diff --git a/README.md b/README.md index a4ac2d6..f94ceab 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,10 @@ Writing your own preprocessor for, i.e SCSS is easy enough, but it can be cumber It is recommended to use with `svelte.config.js` file, located at the project root. For other usage, please refer to [usage documentation](#usage-documentation). ```js -import preprocess from 'svelte-preprocess'; +import { sveltePreprocess } from 'svelte-preprocess'; const config = { - preprocess: preprocess({ ... }) + preprocess: sveltePreprocess({ ... }) } export default config; @@ -121,9 +121,9 @@ _**Note**: needs PostCSS to be installed._ For example, with `@babel/preset-env` your config could be: ```js -import preprocess from 'svelte-preprocess' +import { sveltePreprocess } from 'svelte-preprocess' ... - preprocess: preprocess({ + preprocess: sveltePreprocess({ babel: { presets: [ [ @@ -169,7 +169,7 @@ Which, in a production environment, would turn into ```svelte -{#if "production" !== 'development'} +{#if 'production' !== 'development'}

Production environment!

{/if} ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index 9465c17..99d1570 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -43,7 +43,7 @@ Let's use `svelte-preprocess` in [auto-preprocessing mode](/docs/preprocessing.m ```diff import svelte from 'rollup-plugin-svelte' -+ import sveltePreprocess from 'svelte-preprocess'; ++ import { sveltePreprocess } from 'svelte-preprocess'; const production = !process.env.ROLLUP_WATCH @@ -88,7 +88,7 @@ After the installation is complete, we still need to configure our PostCSS optio ```diff import svelte from 'rollup-plugin-svelte' -import sveltePreprocess from 'svelte-preprocess'; +import { sveltePreprocess } from 'svelte-preprocess'; + import typescript from '@rollup/plugin-typescript'; const production = !process.env.ROLLUP_WATCH @@ -126,9 +126,7 @@ export default { And we're done! Our components can now be written as: ```html - +