# @davidbwaters/webpack-partials

> Partial webpack configs for use with webpack-merge.

Latest version **1.0.11** (published 2020-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @davidbwaters/webpack-partials
pnpm add @davidbwaters/webpack-partials
yarn add @davidbwaters/webpack-partials
bun add @davidbwaters/webpack-partials
```

## 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.11 |
| Published | 2020-06-25 |
| First published | 2020-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 23 |
| Unpacked size | 34.9 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David B. Waters |
| Maintainers | davidbwaters |

## Links

- npm: https://www.npmjs.com/package/@davidbwaters/webpack-partials
- Repository: https://github.com/davidbwaters/webpack-partials
- npm.io page: https://npm.io/package/@davidbwaters/webpack-partials

## Dependencies (23)

- [sass](https://npm.io/package/sass.md) ^1.26.8
- [cssnano](https://npm.io/package/cssnano.md) ^4.1.10
- [webpack](https://npm.io/package/webpack.md) ^4.43.0
- [glob-all](https://npm.io/package/glob-all.md) ^3.2.1
- [css-loader](https://npm.io/package/css-loader.md) ^3.5.3
- [url-loader](https://npm.io/package/url-loader.md) ^4.1.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.10.2
- [file-loader](https://npm.io/package/file-loader.md) ^6.0.0
- [sass-loader](https://npm.io/package/sass-loader.md) ^8.0.2
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^3.3.11
- [app-root-dir](https://npm.io/package/app-root-dir.md) ^1.0.2
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.1.0
- [style-loader](https://npm.io/package/style-loader.md) ^1.2.1
- [webpack-merge](https://npm.io/package/webpack-merge.md) ^4.2.2
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.10.2
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^3.11.0
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^4.3.0
- [clean-webpack-plugin](https://npm.io/package/clean-webpack-plugin.md) ^3.0.0
- [purgecss-webpack-plugin](https://npm.io/package/purgecss-webpack-plugin.md) ^2.2.0
- [webpack-bundle-analyzer](https://npm.io/package/webpack-bundle-analyzer.md) ^3.8.0
- [extract-css-chunks-webpack-plugin](https://npm.io/package/extract-css-chunks-webpack-plugin.md) ^4.7.5
- [babel-plugin-syntax-dynamic-import](https://npm.io/package/babel-plugin-syntax-dynamic-import.md) ^6.18.0
- [optimize-css-assets-webpack-plugin](https://npm.io/package/optimize-css-assets-webpack-plugin.md) ^5.0.3

## Recent versions

- 1.0.11 (latest) — 2020-06-25
- 1.0.10 — 2020-06-25
- 1.0.9 — 2020-06-25
- 1.0.8 — 2020-06-25
- 1.0.7 — 2020-06-23
- 1.0.6 — 2020-06-23
- 1.0.4 — 2020-06-23
- 1.0.2 — 2020-06-23
- 1.0.1 — 2020-06-08
- 1.0.0 — 2020-06-07

## README

Partial webpack configs for use with webpack-merge.

Sample `webpack.config.js`

```
  //
  //  Webpack Config
  //

  const path = require('path')
  const merge = require('webpack-merge')

  const partials = require('@davidbwaters/webpack-partials')

  const rootDir = require('app-root-dir').get()
  const common = merge.smart(
    {
      context: path.resolve(rootDir, 'main'),
      entry: {
        main: './scripts/main.js'
      },
      output: {
        path: path.resolve(rootDir, 'build'),
        filename: '[name][hash].js',
        publicPath: ''
      }
    },
    partials.loaderJsBabel(),
    partials.loaderFontsFile(),
    partials.loaderSvgFile(),
    partials.loaderVideoFile(),
    partials.pluginHtml({
      template: './index.html'
    }),
    partials.pluginBundleAnalyzer()
  )

  const development = merge.smart(
    partials.configDevServer(),
    partials.loaderImageUrl(),
    partials.loaderSassStyle(),
    partials.loaderCssStyle()
  )

  const production = merge.smart(
    partials.configSplitChunks(),
    partials.loaderImageFile(),
    partials.pluginClean(),
    partials.dualCssExtractCssChunks(),
    partials.dualSassExtractCssChunks(),
    partials.pluginOptimizeCssAssets()
  )

  module.exports = (env, argv) => {

    return argv.mode && argv.mode === 'production'
      ? merge.smart(common, production)
      : merge.smart(common, development)

  }
```

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