php-config-loader

0.1.3 • Public • Published

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:

{
    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

Readme

Keywords

Package Sidebar

Install

npm i php-config-loader

Weekly Downloads

4

Version

0.1.3

License

MIT

Unpacked Size

3.79 kB

Total Files

5

Last publish

Collaborators

  • kamil.wylegala