@procore/core-scripts-shims
Version:
Shims that patch core-scripts
59 lines (41 loc) • 1.34 kB
Markdown
# /core-scripts-shims
Shims that patch `/core-scripts`.
```bash
yarn add /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('/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('/core-scripts-shims');
module.exports = () => {
app: {
webpackOverride(config) {
// any other overrides in webpackOverride.
autoPublicPath(config);
}
}
}
```
</details>