# service-gen-loader

> service template generator

Latest version **1.2.2** (published 2020-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install service-gen-loader
pnpm add service-gen-loader
yarn add service-gen-loader
bun add service-gen-loader
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2020-02-07 |
| First published | 2018-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | zhiyingzzhou |
| Maintainers | zhiyingzzhou |
| Keywords | webpack-loader, loader |

## Links

- npm: https://www.npmjs.com/package/service-gen-loader
- Repository: https://github.com/zhiyingzzhou/service-gen-loader
- Homepage: https://github.com/zhiyingzzhou/service-gen-loader#readme
- Issues: https://github.com/zhiyingzzhou/service-gen-loader/issues
- npm.io page: https://npm.io/package/service-gen-loader

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2020-02-07
- 1.2.1 — 2020-02-07
- 1.2.0 — 2019-11-22
- 1.1.9 — 2019-11-22
- 1.1.8 — 2019-11-21
- 1.1.7 — 2019-09-26
- 1.1.6 — 2019-09-26
- 1.1.5 — 2019-09-25
- 1.1.4 — 2019-09-25
- 1.1.3 — 2019-05-06
- 1.1.2 — 2019-04-23
- 1.1.1 — 2019-04-22
- 1.1.0 — 2019-04-22
- 1.0.9 — 2019-01-22
- 1.0.8 — 2019-01-17
- … 11 more at https://npm.io/package/service-gen-loader/versions

## README

## Getting Started

**install**

```console
$ yarn add service-gen-loader -D
```

**service-mapping.json**

```js
import mapping from './service-mapping.json';
```

Then add the loader to your `webpack` config. For example:

**webpack.config.js**

```js
module.exports = {
    module: {
        rules: [
            {
                test: /-mapping.json$/,
                use: [
                    {
                        loader: 'service-gen-loader',
                        options: {
                            fileName: 'service.js',
                            declareFileName: 'service.d.ts',
                            filePath: (ctx) => {
                                return ctx.context;
                            },
                            declareFilePath: (ctx) => {
                                return path.resolve(ctx.context, '../types');
                            }
                        }
                    }
                ]
            }
        ]
    }
}
```

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