# @firstfleet/sveltejs-brunch

> Compile Svelte components inside Brunch projects

Latest version **2.0.2** (published 2022-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @firstfleet/sveltejs-brunch
pnpm add @firstfleet/sveltejs-brunch
yarn add @firstfleet/sveltejs-brunch
bun add @firstfleet/sveltejs-brunch
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2022-04-04 |
| First published | 2021-12-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 2 |
| Unpacked size | 44.5 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jess Patton |
| Maintainers | dwhitak, spies36, brbeaird, grantdaddy, jxpatto |
| Keywords | svelte, brunch, compiler |

## Links

- npm: https://www.npmjs.com/package/@firstfleet/sveltejs-brunch
- Repository: https://github.com/firstfleetinc/sveltejs-brunch
- Homepage: https://github.com/firstfleetinc/sveltejs-brunch#readme
- Issues: https://github.com/firstfleetinc/sveltejs-brunch/issues
- npm.io page: https://npm.io/package/@firstfleet/sveltejs-brunch

## Dependencies (2)

- [svelte](https://npm.io/package/svelte.md) ^3.46.6
- [combine-source-map](https://npm.io/package/combine-source-map.md) ^0.8.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2022-04-04
- 2.0.0-beta.0 (beta) — 2022-03-11
- 2.0.1 — 2022-03-11
- 2.0.0 — 2022-03-11
- 1.0.7 — 2022-01-31
- 1.0.6 — 2022-01-10
- 1.0.5 — 2021-12-21
- 1.0.4 — 2021-12-21
- 1.0.3 — 2021-12-06
- 1.0.2 — 2021-12-06

## README

# sveltejs-brunch

Forked from [sveltejs-brunch](https://github.com/StarpTech/sveltejs-brunch). May include additional changes, newer versions of dependencies, and/or bug fixes that are not in the upstream repo. Changes 
will be submitted via pull request.

WARNING! Version 2.0.0 or > has been converted from CJS to ESM. If you want to use this plugin you will need to use it in conjunction with [@firstfleet/brunch](https://www.npmjs.com/package/@firstfleet/brunch). `@firstfleet/brunch` is a fork of the most recent version of brunch, but has been modified to support both CJS and ESM brunch plugins.

Compile [Svelte 3](https://github.com/sveltejs/svelte) components inside [Brunch](https://github.com/brunch/brunch) projects.

- Extract the CSS into a separate file
- Support CSS & JS Sourcemaps
- Preprocessing of markup, style, script
- Define file extensions which should be compiled
- Pass any Svelte compiler option

# Installation

```
npm install --save-dev @firstfleet/sveltejs-brunch
```

By default all `*.svelte.html`, `.svelte` files are compiled, unless you use the `pattern` option.

# Advanced usage

```js
module.exports.plugins = {
  sveltejs: {
    // To extract the CSS into files, simply include to extractCSS option in your Brunch config like so...
    extractCSS: true,
    // To combine the sourcemaps from all components into one
    combineSourceMapCSS: true,
    // The generated combined css file
    out: './public/components.css',
    // By default, svelte, svelte.html are used.
    pattern: /\.(svelte|html)$/
    // Optionally, preprocess components with svelte.preprocess:
    // https://github.com/sveltejs/svelte#preprocessor-options
    preprocess: {
      style: ({ content }) => {
        return transformStyles(content)
      }
    },
    // Other compiler options https://github.com/sveltejs/svelte#compiler-options
    ...
  }
}
```

# Current list of deviations from origional sveltejs-brunch repo
1. Bug fix for sourcemap generation in brunch [PR](https://github.com/StarpTech/sveltejs-brunch/pull/5)
2. Bug fix for svelte preprocessor. The preprocessor call was not correctly passing through the filename to the preprocessor plugin.
3. Has been converted to ESM (ES Module) to work in conjunction with `@firstfleet/brunch`

---
_Source: https://npm.io/package/@firstfleet/sveltejs-brunch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
