# svelte-ts-preprocess

> Typescript preprocessor for Svelte 3

Latest version **1.1.3** (published 2019-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install svelte-ts-preprocess
pnpm add svelte-ts-preprocess
yarn add svelte-ts-preprocess
bun add svelte-ts-preprocess
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-05-15 |
| First published | 2019-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 1 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 96 |
| Author | PaulMaly |
| Maintainers | paulmaly |
| Keywords | svelte, svelte3, preprocess |

## Links

- npm: https://www.npmjs.com/package/svelte-ts-preprocess
- Repository: https://github.com/PaulMaly/svelte-ts-preprocess
- Issues: https://github.com/PaulMaly/svelte-ts-preprocess/issues
- npm.io page: https://npm.io/package/svelte-ts-preprocess

## Dependencies (1)

- [typescript](https://npm.io/package/typescript.md) ^3.4.4

## Recent versions

- 1.1.3 (latest) — 2019-05-15
- 1.1.2 — 2019-05-06
- 1.1.1 — 2019-05-03
- 1.1.0 — 2019-05-03
- 1.0.1 — 2019-04-12
- 1.0.0 — 2019-04-10

## README

# Typescript preprocessor for Svelte 3

## Install

```bash
npm i svelte-ts-preprocess
```

## Rollup config

```javascript
import svelte from "rollup-plugin-svelte";
import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
import { terser } from "rollup-plugin-terser";

import { preprocess } from "svelte-ts-preprocess";

const production = !process.env.ROLLUP_WATCH;

export default {
  input: "src/main.js",
  output: {
    sourcemap: true,
    format: "iife",
    name: "app",
    file: "public/bundle.js"
  },
  plugins: [
    svelte({
      // enable run-time checks when not in production
      dev: !production,
      // we'll extract any component CSS out into
      // a separate file — better for performance
      css: css => {
        css.write("public/bundle.css");
      },
      preprocess: preprocess()
    }),

    // If you have external dependencies installed from
    // npm, you'll most likely need these plugins. In
    // some cases you'll need additional configuration —
    // consult the documentation for details:
    // https://github.com/rollup/rollup-plugin-commonjs
    resolve(),
    commonjs(),

    // If we're building for production (npm run build
    // instead of npm run dev), minify
    production && terser()
  ]
};
```

# Quick starter template

[svelte-ts-template](https://github.com/pyoner/svelte-ts-template)

# Typings

[svelte-types](https://github.com/pyoner/svelte-types)

---
_Source: https://npm.io/package/svelte-ts-preprocess · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
