# @lekko/webpack-loader

> This package contains Lekko's Webpack plugin for TypeScript projects bundled using Webpack.

Latest version **0.2.1-beta.1** (published 2024-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lekko/webpack-loader
pnpm add @lekko/webpack-loader
yarn add @lekko/webpack-loader
bun add @lekko/webpack-loader
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1-beta.1 |
| Published | 2024-07-11 |
| First published | 2024-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | passichenko, lekko_jonathan, davidsgk, konradlekko |
| Keywords | lekko, webpack, typescript, ts |

## Links

- npm: https://www.npmjs.com/package/@lekko/webpack-loader
- Repository: https://github.com/lekkodev/ts-tools
- Homepage: https://github.com/lekkodev/ts-tools#readme
- Issues: https://github.com/lekkodev/ts-tools/issues
- npm.io page: https://npm.io/package/@lekko/webpack-loader

## Dependencies (3)

- [webpack](https://npm.io/package/webpack.md) ^5.0.0
- [typescript](https://npm.io/package/typescript.md) ~5.4.0
- [@lekko/ts-transformer](https://npm.io/package/@lekko/ts-transformer.md) ^0.2.0 || >=0.2.1-beta.1

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.2.1-beta.1 (latest) — 2024-07-11
- 0.2.0 — 2024-07-10
- 0.2.0-beta.1 — 2024-07-05
- 0.1.0-beta.2 — 2024-07-02
- 0.1.0-beta.1 — 2024-07-01
- 0.0.8-beta.1 — 2024-05-17
- 0.0.7 — 2024-04-22
- 0.0.6 — 2024-04-11
- 0.0.6-beta.2 — 2024-04-10
- 0.0.5 — 2024-04-05
- 0.0.4 — 2024-04-05
- 0.0.3 — 2024-04-03
- 0.0.2 — 2024-04-03
- 0.0.1 — 2024-03-29
- 0.0.0-beta-5 — 2024-03-27
- … 4 more at https://npm.io/package/@lekko/webpack-loader/versions

## README

# @lekko/webpack-loader

This package contains Lekko's Webpack plugin for TypeScript projects bundled using Webpack.

These build tools transform your locally defined TypeScript config functions under `lekko/` into code that can communicate with Lekko and serve up-to-date dynamically configured values.

## Installation

### NPM

```
npm install -D @lekko/webpack-loader
```

### Yarn

```
yarn add -D @lekko/webpack-loader
```

### Lekko CLI

This package depends on the Lekko CLI for local development. Installing it and setting up an account will make sure your project can communicate with Lekko's services for dynamic configuration correctly.

```
brew tap lekkodev/lekko
brew install lekko

lekko setup
```

## Usage

This package has 2 main parts, the loader and the plugin:

- The loader is responsible for:
  - Transforming code under `lekko/` at build time
  - Translating config functions defined in TypeScript to a cross-language DSL, stored locally on the filesystem to be pushed to remote
- The plugin is responsible for:
  - Emitting Lekko-specific environment variables for running your project in production mode
    - Lekko's SDK clients will automatically read these environment variables

> [!NOTE]
> You only want the loader and plugin to run for **production builds**. Make sure that you add them to your production webpack configs.

Example: In your `webpack.prod.config.js`:

```typescript
const lekko = require("@lekko/webpack-loader");

...

module.exports = {
  ...
  plugins: [
    // Pass the appropriate env var `prefix` so that Lekko env vars will be picked up
    new lekko.LekkoPlugin({ prefix: "REACT_APP_" }),
  ]
}
```

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