# webpack-react-conf

> webpack react configuration

Latest version **1.0.9** (published 2016-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-react-conf
pnpm add webpack-react-conf
yarn add webpack-react-conf
bun add webpack-react-conf
```

## 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.0.9 |
| Published | 2016-07-31 |
| First published | 2016-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5 |
| Dependencies | 10 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Juan Picado |
| Maintainers | jotadeveloper |

## Links

- npm: https://www.npmjs.com/package/webpack-react-conf
- Repository: https://github.com/juanpicado/webpack-react-conf
- Homepage: https://github.com/juanpicado/webpack-react-conf#readme
- Issues: https://github.com/juanpicado/webpack-react-conf/issues
- npm.io page: https://npm.io/package/webpack-react-conf

## Dependencies (10)

- [lodash](https://npm.io/package/lodash.md) ^4.13.1
- [css-loader](https://npm.io/package/css-loader.md) ^0.23.1
- [url-loader](https://npm.io/package/url-loader.md) ^0.5.7
- [file-loader](https://npm.io/package/file-loader.md) ^0.9.0
- [sass-loader](https://npm.io/package/sass-loader.md) ^4.0.0
- [style-loader](https://npm.io/package/style-loader.md) ^0.13.1
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^0.9.1
- [babel-preset-react](https://npm.io/package/babel-preset-react.md) 6.11.1
- [webpack-babel-conf](https://npm.io/package/webpack-babel-conf.md) 1.*
- [extract-text-webpack-plugin](https://npm.io/package/extract-text-webpack-plugin.md) ^1.0.1

## Recent versions

- 1.0.9 (latest) — 2016-07-31
- 1.0.8 — 2016-07-31
- 1.0.7 — 2016-07-31
- 1.0.6 — 2016-07-30
- 1.0.5 — 2016-07-20
- 1.0.4 — 2016-07-13
- 1.0.3 — 2016-07-13
- 1.0.2 — 2016-07-07
- 1.0.1 — 2016-07-07
- 1.0.0 — 2016-05-31

## README

## webpack-react-conf

This module helps to reduce the overloaded webpack configuration using **babel and JSX** as a default loader, dependencies management.

    npm install webpack-react-conf --save-dev
    
The configuration contains the following loaders:

* scss-loader (.scss) `node-sass required`
* file-loader
* style-loader (css modules)
* postcss-loader
* url-loader (jpg and png)

It bundle a file (style.css) with all components that use styles as references.

## Usage

* Create a file in the root folder `webpack.conf.js` and add the following code.

````
    const configuration = require('webpack-react-conf');
    const webpackConf = configuration(
    './src/index.jsx',
    './build',
    'index.min.js',
    'myAppFoo',
    'umd');
    module.exports = webpackConf;
````

* Define your React Component at `./src/index.jsx`

`````
import React from 'react';
import ReactDOM from 'react-dom';

class HelloWorld extends React.Component {
  render() {
    return <p>Hello, world!</p>;
  }
}

ReactDOM.render(<HelloWorld />, document.getElementById('app'));

export default HelloWorld;

`````


* Run webpack in the root folder `webpack --config webpack.conf.js`
* Look the output file at `build/index.min.js`
* Test your component in a web server

#### Options

The module returns a function, it accepts 4 parameters.

1. The entry point file
2. The output name
3. The name of the library
4. The library target

#### Examples

[https://github.com/juanpicado/webpack-examples/tree/master/react-bundle](https://github.com/juanpicado/webpack-examples/tree/master/react-bundle)


This module extends [webpack-babel-conf](https://github.com/juanpicado/webpack-babel-conf)

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