# @procore/core-scripts-shims

Shims that patch `@procore/core-scripts`.

```bash
yarn add @procore/core-scripts-shims
```

This package contains shims to patch `core-scripts`. These are useful when it's either difficult to upgrade `core-scripts` in a timely fashion or to patch things that are not easily changeable in `core-scripts`.

## Usage

<details>
  <summary>Simple Example</summary>

```js
// procore.config.js
const { aShim } = require('@procore/core-scripts-shims');

module.exports = () => {
  app: {
    webpackOverride(config) {
      // any other overrides in webpackOverride.

      // Apply the desired shim.
      aShim(config);
    }
  }
}
```

</details>

## Available Shims

### `autoPublicPath`

This shim will patch the publicPath to be consistent across usages in the core-scripts webpack configuration, and enables the use of the "auto" public path for context-free MFE deployments. "context-free" means no more needing to specify a `--publicPath` value!

<details>
  <summary>Automatically convert from json response with a text fallback.</summary>

```js
// procore.config.js
const { autoPublicPath } = require('@procore/core-scripts-shims');

module.exports = () => {
  app: {
    webpackOverride(config) {
      // any other overrides in webpackOverride.

      autoPublicPath(config);
    }
  }
}
```

</details>
