Socket
Socket
Sign inDemoInstall

svelte-preprocess

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-preprocess - npm Package Compare versions

Comparing version 2.15.2 to 2.16.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# [2.16.0](https://github.com/kaisermann/svelte-preprocess/compare/v2.15.2...v2.16.0) (2019-08-28)
## [2.15.2](https://github.com/kaisermann/svelte-preprocess/compare/v2.15.0...v2.15.2) (2019-08-28)

@@ -2,0 +6,0 @@

2

package.json
{
"name": "svelte-preprocess",
"version": "2.15.2",
"version": "2.16.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -380,2 +380,8 @@ # Svelte Preprocess

},
/**
* Type checking can be skipped by setting 'transpileOnly: true'.
* This speeds up your build process.
*/
transpileOnly: true,
},

@@ -426,1 +432,23 @@

If you have configured `svelte-preprocess` to use some kind of preprocessor and `svelte-vscode` is displaying errors like it's ignoring your preprocess configuration, that's happening because `svelte-vscode` needs to know how to preprocess your components. `svelte-vscode` works by having a svelte compiler running on the background and you can configure it by [creating a `svelte.config.js`](#with-svelte-vs-code) file on your project's root. Please check this document [With Svelte VS Code](#with-svelte-vs-code) section.
### My `typescript` compilation is sloooooooow
If you have a medium-to-big project, the typescript processor might start to get slow. If you already have an IDE type checking your code, you can speed up the transpilation process by setting `transpileOnly` to `true`:
```js
const preprocess = require('svelte-preprocess')
...
{
...svelteOptions,
preprocess: preprocess({
typescript: {
// skips type checking
transpileOnly: true,
compilerOptions: {
...
},
},
})
}
...
```

@@ -198,6 +198,19 @@ const ts = require('typescript')

const { code, map, diagnostics } = compileFileFromMemory(compilerOptions, {
filename,
content,
})
let code, map, diagnostics
if (options.transpileOnly || compilerOptions.transpileOnly) {
;({
outputText: code,
sourceMapText: map,
diagnostics,
} = ts.transpileModule(content, {
fileName: filename,
compilerOptions: compilerOptions,
reportDiagnostics: options.reportDiagnostics !== false,
}))
} else {
;({ code, map, diagnostics } = compileFileFromMemory(compilerOptions, {
filename,
content,
}))
}

@@ -204,0 +217,0 @@ if (diagnostics.length > 0) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc