# @castiron/webpack-config-factory

> A single webpack configuration for CIC projects.

Latest version **0.4.6-beta.2** (published 2025-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @castiron/webpack-config-factory
pnpm add @castiron/webpack-config-factory
yarn add @castiron/webpack-config-factory
bun add @castiron/webpack-config-factory
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.4.6-beta.2 |
| Published | 2025-12-16 |
| First published | 2021-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 14.15.0 |
| Dependencies | 23 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+11 in 2 direct dependencies) |
| Install scripts | no |
| Author | Cast Iron Coding |
| Maintainers | castiron-owner, zdavis, jen-castiron, dananjohnson |

## Links

- npm: https://www.npmjs.com/package/@castiron/webpack-config-factory
- Repository: https://github.com/castiron/cic-webpack-config-factory
- npm.io page: https://npm.io/package/@castiron/webpack-config-factory

## Dependencies (23)

- [sass](https://npm.io/package/sass.md) ^1.62.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [postcss](https://npm.io/package/postcss.md) 8.4.23
- [webpack](https://npm.io/package/webpack.md) ^5.84.1
- [css-loader](https://npm.io/package/css-loader.md) ^6.7.4
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.22.0
- [sass-loader](https://npm.io/package/sass-loader.md) 13.3.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^5.1.1
- [babel-loader](https://npm.io/package/babel-loader.md) ^9.1.2
- [browserslist](https://npm.io/package/browserslist.md) ^4.21.5
- [style-loader](https://npm.io/package/style-loader.md) ^3.3.3
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^7.3.1
- [react-dev-utils](https://npm.io/package/react-dev-utils.md) ^12.0.1
- [webpack-sources](https://npm.io/package/webpack-sources.md) ^3.2.1
- [postcss-normalize](https://npm.io/package/postcss-normalize.md) ^10.0.1
- [postcss-preset-env](https://npm.io/package/postcss-preset-env.md) ^8.4.1
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^4.15.0
- [webpack-php-manifest](https://npm.io/package/webpack-php-manifest.md) ^0.0.9
- [babel-preset-react-app](https://npm.io/package/babel-preset-react-app.md) ^10.0.0
- [mini-css-extract-plugin](https://npm.io/package/mini-css-extract-plugin.md) ^2.7.6
- [webpack-assets-manifest](https://npm.io/package/webpack-assets-manifest.md) ^5.0.6
- [css-minimizer-webpack-plugin](https://npm.io/package/css-minimizer-webpack-plugin.md) ^5.0.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.14.5

## Recent versions

- 0.4.6-beta.2 (latest) — 2025-12-16
- 0.4.6-beta.1 — 2025-12-16
- 0.4.6-beta.0 — 2025-12-16
- 1.0.0 — 2025-05-13
- 1.0.0-beta.1 — 2025-02-08
- 0.4.5 — 2025-02-05
- 0.4.5-beta.0 — 2025-02-05
- 1.0.0-beta.0 — 2025-02-03
- 0.4.5-beta.1 — 2025-01-31
- 0.4.4 — 2025-01-30
- 0.4.4-beta.1 — 2024-11-15
- 0.4.4-beta.0 — 2024-11-14
- 0.4.3 — 2023-06-23
- 0.4.2 — 2023-06-15
- 0.4.1 — 2023-05-30
- … 17 more at https://npm.io/package/@castiron/webpack-config-factory/versions

## README

# CIC Webpack Config Factory

A single webpack configuration for CIC projects.

## Supported CMS

- October
- Wordpress

## Install Instructions

1. `yarn add @castiron/webpack-config-factory`
2. If there are any existing webpack config files, delete them.
3. Copy the contents of the `/samples` directory into your project somewhere and update as needed.
4. Add a babel preset to `package.json` if desired.
```json
  "babel": {
    "presets": [
      "react-app"
    ]
  },
```
5. Add a browserslist definition to `package.json` if one is not already there.
```json
"browserslist": [
  "defaults"
],
```
6. Update your scripts in `package.json` if needed to use the new config files.

### Migrating babel polyfill to core-js

`@babel/polyfill` is [deprecated](https://babeljs.io/docs/en/babel-polyfill) in favor of `core-js`.
`@babel/polyfill` used `core-js` under the hood, so the migration process is very straightforward.

```diff
-import "@babel/polyfill";
+import "core-js/stable";
+import "regenerator-runtime/runtime";
```

### Sample `package.json` scripts
```json
"scripts": {
  "dev": "NODE_ENV=development WEBPACK_DEV_SERVER=true webpack-dev-server --config config/webpack/dev.conf.js",
  "watch": "NODE_ENV=development webpack --watch --config config/webpack/prod.conf.js",
  "build": "NODE_ENV=production webpack --bail --config config/webpack/prod.conf.js",
}
```

## Development

1. In this repo, run `yarn link`.
2. In your project, run `yarn link @castiron/webpack-config-factory`.

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