# @sanity/webpack-integration

> Tools and modules required for making partisan (the part system) work with webpack

Latest version **2.36.2** (published 2023-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sanity/webpack-integration
pnpm add @sanity/webpack-integration
yarn add @sanity/webpack-integration
bun add @sanity/webpack-integration
```

## 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 | 2.36.2 |
| Published | 2023-07-25 |
| First published | 2017-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 14 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sanity.io |
| Maintainers | jonabc, kenjonespizza, pauloborgesf, binoy14, simen.svale, benjaminakar, svirs, josh_sanity_io, joneidejohnsen, nina.andal, rankers, snorreeb, mattcraig, vincentquigley, stipsan, michael-sanity, rubioz, tonina, ritasdias, simeonsanity, kmelve, bjoerge, rexxars, skogsmaskin, robinpyon, mariuslundgard, sanity-io, evenw, radhe_sanity, rbotten, vicbergquist, judofyr, obliadp, dcilke, fredcarlsen, hermanw, mikolajsanity, sgulseth, atombender |
| Keywords | sanity, cms, headless, realtime, content, webpack-integration, webpack |

## Links

- npm: https://www.npmjs.com/package/@sanity/webpack-integration
- Repository: https://github.com/sanity-io/sanity
- Homepage: https://www.sanity.io/
- Issues: https://github.com/sanity-io/sanity/issues
- npm.io page: https://npm.io/package/@sanity/webpack-integration

## Dependencies (14)

- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [postcss](https://npm.io/package/postcss.md) ^8.2.0
- [resolve](https://npm.io/package/resolve.md) ^1.3.3
- [fs.realpath](https://npm.io/package/fs.realpath.md) ^1.0.0
- [postcss-url](https://npm.io/package/postcss-url.md) ^7.3.1
- [postcss-calc](https://npm.io/package/postcss-calc.md) ^7.0.0
- [p-async-cache](https://npm.io/package/p-async-cache.md) ^1.0.2
- [postcss-import](https://npm.io/package/postcss-import.md) ^11.0.0
- [postcss-cssnext](https://npm.io/package/postcss-cssnext.md) ^3.0.2
- [@sanity/resolver](https://npm.io/package/@sanity/resolver.md) 2.36.2
- [css-color-function](https://npm.io/package/css-color-function.md) ^1.3.3
- [@sanity/webpack-loader](https://npm.io/package/@sanity/webpack-loader.md) 2.36.2
- [postcss-color-function](https://npm.io/package/postcss-color-function.md) ^4.1.0
- [postcss-custom-properties](https://npm.io/package/postcss-custom-properties.md) ^6.3.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.36.2 (latest) — 2023-07-25
- 2.36.6 (v2) — 2024-11-07
- 2.36.2-weighted-search.16 (weighted-search) — 2023-07-14
- 2.34.3-cdr-ga-4.23 (cdr-ga-4) — 2022-10-20
- 2.34.3-cdr-ga-2.19 (cdr-ga-2) — 2022-10-20
- 2.34.3-cdr-ga.20 (cdr-ga) — 2022-10-20
- 2.34.3-cdr-preview.20 (cdr-preview) — 2022-10-20
- 2.34.2-empty-template-cli.0 (empty-template-cli) — 2022-10-13
- 2.34.1-canary.0 (canary) — 2022-10-12
- 2.33.4-shopify.8 (shopify) — 2022-09-22
- 2.33.4-performance-opts.16 (performance-opts) — 2022-09-22
- 2.33.3-edge.8 (edge) — 2022-09-20
- 2.30.7-findability.87 (findability) — 2022-09-20
- 2.33.1-performance-opts-doc-pane.2 (performance-opts-doc-pane) — 2022-09-12
- 2.32.1-next.22 (next) — 2022-09-08
- … 658 more at https://npm.io/package/@sanity/webpack-integration/versions

## README

# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.

# @sanity/webpack-integration

Tools and modules required for making partisan (the part system) work with webpack. Note: currently only works with Webpack 1.

## Installing

```
npm install --save @sanity/webpack-integration
```

## Usage

```js
const sanityWebpack = require('@sanity/webpack-integration/v1')
const options = {
  basePath: '/path/to/project',
  env: 'production',
}

// Get array of plugins required for part loading
sanityWebpack.getPlugins(options)

// Get array of loader definitions required for part loading
sanityWebpack.getLoaders(options)

// Get array of postcss plugins required to build the CSS used in Sanity
sanityWebpack.getPostcssPlugins(options)

// Get a partial webpack configuration for the Sanity-specific parts. You'll have to merge this with your existing webpack config.
sanityWebpack.getConfig(options)

// Less common, but if you need more fine-grained access to internals:

// Get a preconfigured `DefinePlugin` that exposes `__DEV__`
sanityWebpack.getEnvPlugin(options)

// Get the part resolver plugin required for part imports
sanityWebpack.getPartResolverPlugin(options)

// Get the part loader (requires the PartResolverPlugin)
sanityWebpack.getPartLoader(options)

// Get the resolving function required for postcss-import
sanityWebpack.getStyleResolver(options)

// Get an initialized postcss-import plugin
sanityWebpack.getPostcssImportPlugin(options)
```

## License

MIT-licensed. See LICENSE.

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