# php-config-loader

> Webpack loader that converts php associative array into JSON object.

Latest version **0.1.4** (published 2026-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install php-config-loader
pnpm add php-config-loader
yarn add php-config-loader
bun add php-config-loader
```

## Health

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

Positive: no vulnerabilities; recently updated.

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

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2026-07-29 |
| First published | 2021-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kamil Wylegała |
| Maintainers | kamil.wylegala |
| Keywords | php, webpack, loader |

## Links

- npm: https://www.npmjs.com/package/php-config-loader
- npm.io page: https://npm.io/package/php-config-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

- 0.1.4 (latest) — 2026-07-29
- 0.1.3 — 2021-02-27
- 0.1.2 — 2021-02-26
- 0.1.1 — 2021-02-26
- 0.1.0 — 2021-02-26

## README

# php-config-loader

Webpack plugin that transforms php file into JSON object.

## What's the use case?

An app might have a backend side written in PHP and there are resources that would be good to share between the backend and frontend like: configurations, translations. One way is to transform php array configuration into JSON object and bundle it with Webpack. This plugin may help.

## Installation

```
npm install php-config-loader
```

Add to `webpack.config.js` under `module.rules`:
```js
{
    test: /\.php$/,
    use: [
        {
            loader: "php-config-loader",
        }
    ]
}
```

Then in your `js` file:
```
import config from "../config.php";
```

## Development

```
npm test
git add .
git commit
npm version
npm publish --access=public
```

## License

MIT

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