# @fbi-js/webpack-config-base

> Webpack base config

Latest version **1.6.3** (published 2021-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fbi-js/webpack-config-base
pnpm add @fbi-js/webpack-config-base
yarn add @fbi-js/webpack-config-base
bun add @fbi-js/webpack-config-base
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.3 |
| Published | 2021-03-11 |
| First published | 2021-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 30 |
| Unpacked size | 85.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fbi |
| Maintainers | neikvon, wendaosanshou |

## Links

- npm: https://www.npmjs.com/package/@fbi-js/webpack-config-base
- Repository: https://github.com/fbi-js/config
- Homepage: https://github.com/fbi-js/config/tree/master/packages/webpack-config-base
- Issues: https://github.com/fbi-js/config/issues
- npm.io page: https://npm.io/package/@fbi-js/webpack-config-base

## Dependencies (30)

- [less](https://npm.io/package/less.md) ^4.1.1
- [sass](https://npm.io/package/sass.md) ^1.32.8
- [chalk](https://npm.io/package/chalk.md) 2.4.x
- [figures](https://npm.io/package/figures.md) 2.0.x
- [postcss](https://npm.io/package/postcss.md) ^8.2.6
- [css-loader](https://npm.io/package/css-loader.md) ^5.0.2
- [log-update](https://npm.io/package/log-update.md) 2.3.x
- [url-loader](https://npm.io/package/url-loader.md) ^4.1.1
- [webpackbar](https://npm.io/package/webpackbar.md) ^5.0.0-3
- [less-loader](https://npm.io/package/less-loader.md) ^8.0.0
- [sass-loader](https://npm.io/package/sass-loader.md) ^11.0.1
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.2.2
- [style-loader](https://npm.io/package/style-loader.md) ^2.0.0
- [@svgr/webpack](https://npm.io/package/@svgr/webpack.md) ^5.5.0
- [webpack-merge](https://npm.io/package/webpack-merge.md) ^5.7.3
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^5.0.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.13.5
- [mini-svg-data-uri](https://npm.io/package/mini-svg-data-uri.md) ^1.2.3
- [postcss-preset-env](https://npm.io/package/postcss-preset-env.md) ^6.7.0
- [babel-plugin-import](https://npm.io/package/babel-plugin-import.md) ^1.13.3
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) ^7.0.0
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^5.2.0
- [clean-webpack-plugin](https://npm.io/package/clean-webpack-plugin.md) ^3.0.0
- [eslint-webpack-plugin](https://npm.io/package/eslint-webpack-plugin.md) ^2.5.2
- [mini-css-extract-plugin](https://npm.io/package/mini-css-extract-plugin.md) ^1.3.8
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.13.0
- [stylelint-webpack-plugin](https://npm.io/package/stylelint-webpack-plugin.md) ^2.1.1
- [css-minimizer-webpack-plugin](https://npm.io/package/css-minimizer-webpack-plugin.md) ^1.2.0
- [@opd/css-modules-typings-loader](https://npm.io/package/@opd/css-modules-typings-loader.md) ^1.0.5
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.13.0

## Recent versions

- 1.6.3 (latest) — 2021-03-11
- 1.6.2 — 2021-03-11
- 1.6.1 — 2021-03-11
- 1.6.0 — 2021-03-11
- 1.5.7 — 2021-03-09
- 1.5.6 — 2021-02-25
- 1.5.5 — 2021-02-25
- 1.5.4 — 2021-01-29
- 1.5.3 — 2021-01-27
- 1.5.2 — 2021-01-27
- 1.5.1 — 2021-01-26
- 1.5.0 — 2021-01-22
- 1.4.0 — 2021-01-12
- 1.3.0 — 2021-01-12
- 1.2.1 — 2021-01-08
- … 7 more at https://npm.io/package/@fbi-js/webpack-config-base/versions

## README

# @fbi-js/webpack-config-base

Webpack base config.

## Features

- JavaScript
- TypeScript
- SASS
- LESS
- PostCSS
- ESLint
- StyleLint

## Usage

```bash
npm i -D @fbi-js/webpack-config-base webpack@5 webpack-dev-server@next
```

- `./webpack.config.js`

  ```js
  const config = require('@fbi-js/webpack-config-base').default

  // default
  module.exports = config()

  // extends
  module.exports = {
    ...config(),
    entry: './index.js'
  }

  // with options
  module.exports = config({
    options: {
      isTs: true
    }
  })
  ```

- or `./webpack.config.ts`

  ```ts
  import config from '@fbi-js/webpack-config-base'

  // default
  export default config()

  // extends
  export default {
    ...config(),
    entry: './index.js'
  }

  // with options
  export default config({
    options: {
      isTs: true
    }
  })
  ```

## Options

```ts
interface Options {
  // project title (used by html-webpack-plugin and webpackbar)
  title?: string
  // using typescript or not
  isTs?: boolean
  // common paths config. Type: https://github.com/fbi-js/config/blob/main/packages/webpack-config-base/src/types.ts#L4
  paths: PathsConfig
  // used by webpack.DefinePlugin. https://webpack.js.org/plugins/define-plugin/
  definePluginData: Record<string, any>
  // https://webpack.js.org/configuration/optimization/
  optimization: Configuration['optimization']
  // https://webpack.js.org/configuration/performance/
  performance: Configuration['performance']
  // https://webpack.js.org/configuration/stats/
  stats: Configuration['stats']
  // https://webpack.js.org/configuration/dev-server/
  devServer: Record<string, any>
  // https://github.com/babel/babel-loader#options
  babel: Record<string, any>
  // https://github.com/webpack-contrib/css-loader#options
  css: Record<string, any>
  // https://github.com/webpack-contrib/postcss-loader#options
  postcss: Record<string, any>
  // https://github.com/webpack-contrib/sass-loader#options
  sass: Record<string, any>
  // https://github.com/webpack-contrib/less-loader#options
  less: Record<string, any>
  // https://github.com/webpack-contrib/eslint-webpack-plugin#options
  eslint: Record<string, any>
  // https://github.com/webpack-contrib/stylelint-webpack-plugin#options
  stylelint: Record<string, any>
  // https://github.com/survivejs/webpack-merge#mergewithrules
  mergeRules: MergeRules
}
```

## License

Licensed under [MIT](https://opensource.org/licenses/MIT).

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