# @quatico/websmith-webpack

> Webpack loader for @quatico/websmith-compiler

Latest version **0.6.3** (published 2025-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @quatico/websmith-webpack
pnpm add @quatico/websmith-webpack
yarn add @quatico/websmith-webpack
bun add @quatico/websmith-webpack
```

## Health

**Score 50/100 (C)** — status: stable.

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

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.6.3 |
| Published | 2025-01-23 |
| First published | 2022-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 127.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Quatico Solutions AG |
| Maintainers | quatico-admin, jwloka |

## Links

- npm: https://www.npmjs.com/package/@quatico/websmith-webpack
- Repository: https://github.com/quatico-solutions/websmith
- Homepage: https://github.com/quatico-solutions/websmith#readme
- Issues: https://github.com/quatico-solutions/websmith/issues
- npm.io page: https://npm.io/package/@quatico/websmith-webpack

## Dependencies (2)

- [@quatico/websmith-api](https://npm.io/package/@quatico/websmith-api.md) 0.6.3
- [@quatico/websmith-core](https://npm.io/package/@quatico/websmith-core.md) 0.6.3

## Recent versions

- 0.6.3 (latest) — 2025-01-23
- 0.6.2 — 2025-01-22
- 0.6.1 — 2025-01-20
- 0.6.0 — 2024-05-19
- 0.5.3 — 2024-04-19
- 0.5.2 — 2024-04-19
- 0.5.1 — 2024-04-18
- 0.4.2 — 2023-08-11
- 0.4.1 — 2023-08-11
- 0.4.0 — 2023-05-12
- 0.3.5 — 2023-02-01
- 0.3.4 — 2022-11-23
- 0.3.3 — 2022-11-18
- 0.3.2 — 2022-11-18
- 0.2.2 — 2022-07-08
- … 2 more at https://npm.io/package/@quatico/websmith-webpack/versions

## README

<!--
 ---------------------------------------------------------------------------------------------
   Copyright (c) Quatico Solutions AG. All rights reserved.
   Licensed under the MIT License. See LICENSE in the project root for license information.
 ---------------------------------------------------------------------------------------------
-->
# websmith-webpack

A custom webpack loader to add the websmith compiler to your build and bundling process.

Visit the [websmith github repository](https://github.com/quatico-solutions/websmith) for more information and examples.

## Getting started

### Installation

Install the websmith webpack loader using npm:

```sh
npm i -D @quatico/websmith-webpack
```

### Add websmith configuration

A `websmith.config.json` file is needed to configure which addons should be used by websmith during the webpack compilation process:

```json
// websmith.config.json
{
    "targets": {
        "executeAddons": {
            "addons": ["my-addon"],
            "writeFile": false,
        },
    }
}
```

**Note:** The webpack loader will expect a target called `executeAddons` which we need to configure in the webpack configuration.

### Add webpack configuration

Now we can use the `@quatico/websmith-webpack` loader and the websmith configuration to configure webpack.

```javascript
// webpack.config.js
const { join } = require("path");

module.exports = {
    ...
    module: {
        rules: [
            ...,
            {
                test: /\.(?:[j|t]sx?)$/,
                include: [sourceDir],
                exclude: [/node_modules/],
                use: [
                    {
                        loader: "@quatico/websmith-webpack",
                        options: {
                            project: join(__dirname, "tsconfig.json"),
                            config,
                            targets: "executeAddons",
                            webpackTarget: "executeAddons",
                        },
                    },
                ],
            },
            ...
        ],
    },
};
```

### Bundle your project

You can run webpack in one of your build targets with:

```sh
webpack
```

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