# webpack-config-rentpath

> Shared webpack config across our apps

Latest version **1.5.3** (published 2016-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-config-rentpath
pnpm add webpack-config-rentpath
yarn add webpack-config-rentpath
bun add webpack-config-rentpath
```

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.3 |
| Published | 2016-08-23 |
| First published | 2016-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2.1 |
| Dependencies | 27 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | rentpath |

## Links

- npm: https://www.npmjs.com/package/webpack-config-rentpath
- Repository: https://github.com/rentpath/webpack-config-rentpath
- Issues: https://github.com/rentpath/webpack-config-rentpath/issues
- npm.io page: https://npm.io/package/webpack-config-rentpath

## Dependencies (27)

- [glob](https://npm.io/package/glob.md) ^6.0.3
- [dotenv](https://npm.io/package/dotenv.md) ^2.0.0
- [webpack](https://npm.io/package/webpack.md) ^1.12.2
- [node-sass](https://npm.io/package/node-sass.md) ^3.3.3
- [babel-core](https://npm.io/package/babel-core.md) ^6.4.0
- [css-loader](https://npm.io/package/css-loader.md) ^0.21.0
- [handlebars](https://npm.io/package/handlebars.md) ^4.0.3
- [file-loader](https://npm.io/package/file-loader.md) ^0.8.4
- [sass-loader](https://npm.io/package/sass-loader.md) ^3.0.0
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^6.3.6
- [babel-loader](https://npm.io/package/babel-loader.md) ^6.2.0
- [style-loader](https://npm.io/package/style-loader.md) ^0.13.0
- [coffee-loader](https://npm.io/package/coffee-loader.md) ^0.7.2
- [coffee-script](https://npm.io/package/coffee-script.md) ^1.9.3
- [script-loader](https://npm.io/package/script-loader.md) ^0.6.1
- [exports-loader](https://npm.io/package/exports-loader.md) ^0.6.2
- [imports-loader](https://npm.io/package/imports-loader.md) ^0.6.5
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^0.9.1
- [webpack-md5-hash](https://npm.io/package/webpack-md5-hash.md) ^0.0.5
- [handlebars-loader](https://npm.io/package/handlebars-loader.md) ^1.1.4
- [babel-preset-react](https://npm.io/package/babel-preset-react.md) ^6.3.13
- [resolve-url-loader](https://npm.io/package/resolve-url-loader.md) ^1.3.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.3.13
- [image-webpack-loader](https://npm.io/package/image-webpack-loader.md) ^1.6.3
- [assets-webpack-plugin](https://npm.io/package/assets-webpack-plugin.md) ^3.1.0
- [webpack-asset-manifest](https://npm.io/package/webpack-asset-manifest.md) github:rentpath/webpack-asset-manifest
- [extract-text-webpack-plugin](https://npm.io/package/extract-text-webpack-plugin.md) ^0.8.2

## Recent versions

- 1.5.3 (latest) — 2016-08-23
- 1.5.2 — 2016-06-14
- 1.5.1 — 2016-06-14
- 1.5.0 — 2016-05-09
- 1.4.0 — 2016-04-26
- 1.3.0 — 2016-04-05
- 1.2.0 — 2016-04-04
- 1.1.1 — 2016-03-31
- 1.1.0 — 2016-03-30
- 1.0.0 — 2016-03-25

## README

# webpack-config-rentpath
Shared webpack config across RentPath apps.

## Installation
```bash
$ npm i --save webpack-config-rentpath
```

## Usage
The most minimal usage would be to create a `webpack.config.js` file in the root of your app with the following content:
```javascript
module.exports = require('webpack-config-rentpath').config
```

If your app requires any webpack aliases ([`resolve.alias`](https://webpack.github.io/docs/resolving.html#aliasing)), create a separate file `webpack-alias.config.js` that exports the alias hash. The file will automatically be found and loaded by the base config. For example:

```javascript
module.exports = {
  "gallery": "gallery.js/dist",
  "login": "login/dist",
  "tealium": "tealium/dist/tagging.js"
};
```

If your app requires Babel presets other than `es2015`, make sure to declare them in `.babelrc` in the root of your app. For example:

```json
{ "presets": ["es2015", "react"] }
```

If you require any other customizations, you will need to edit `webpack.config.js` such that it mutates the standard config before exporting it as described below.

### Extended configuration

The config that this package exports is a base config reflecting RentPath's opinions. If your app has special needs, it can mutate the base config. For example:

```javascript
var config = require('webpack-config-rentpath').config

// Add a loader
config.module.loaders.push({ test: /everestjs\/index.js$/, loader: "script-loader" })

// Add a plugin
var webpack = require('webpack')
config.plugins.push(new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/))

module.exports = config
```

If you need to make environment-specific config changes, you can take advantage of the `appEnv` variable that `webpack-config-rentpath` exports in addition to `config`. The value of `appEnv` is a string obtained from the environment variable `APPLICATION_ENVIRONMENT` and defaults to `"production"` if missing. For example:

```javascript
var webpackConfigRentpath = require('webpack-config-rentpath')
var config = webpackConfigRentpath.config
var appEnv = webpackConfigRentpath.appEnv

if(appEnv == 'development') {
  // do some dev stuff
}

if(appEnv != 'development') {
  // do some non-dev stuff
}

if(appEnv == 'production') {
  // do some production stuff
}

module.exports = config
```

## Scripts
* `npm run compile` - Compiles the module to disk (~/lib).
* `npm run compile:watch` - Same as `npm run compile` but watches files for changes.
* `npm run lint` - Lints all files.
* `npm run lint:fix` - Lints all files and attempts to fix any issues.
* `npm run test` - Runs unit tests.
* `npm run test:watch` - Same as `npm test` but watches files for changes.
* `npm run test:cov` - Generates a test coverage report.


## Commitizen
 `webpack-config-rentpath` uses [Commitizen](https://commitizen.github.io/cz-cli/) to format commit messages.
 * Install it globally `$ npm install -g commitizen`
Once you are ready to commit, follow the familiar github workflow, with a slight change.
```
$ git add <files>
$ git cz
```
`git cz` will bring up the Commitizen commit prompt, follow the instructions, and `$ git push` as usual.

This commit message format is used for `semantic-release`.

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