Skip to content
/ bud Public

Commit 711074d

Browse files
authored
🩹 fix(@roots/entrypoints-webpack-plugin): stale caching (#2363)
- 🩹 fix(@roots/entrypoints-webpack-plugin): entrypoints.json artifact could become stale ## Type of change **PATCH: backwards compatible change**
1 parent 3f40364 commit 711074d

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

sources/@repo/docs/config/docusaurus.theme.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ const navbar = {
125125
},
126126
{
127127
items: [
128-
{label: `latest`, to: `/releases/tags/6-13`},
128+
{label: `latest`, to: `/releases/tags/6-14`},
129+
{label: `6.13`, to: `/releases/tags/6-13`},
129130
{label: `6.12`, to: `/releases/tags/6-12`},
130131
{label: `6.11`, to: `/releases/tags/6-11`},
131132
{label: `6.9`, to: `/releases/tags/6-9`},

sources/@repo/docs/content/guides/general-use/node-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Overview of instantiating bud.js directly from Node
44
sidebar_label: Node API
55
---
66

7-
import NodeAPI from '!!raw-loader!@site/../../../examples/node-api/01-simple.js'
7+
import NodeAPI from '!!raw-loader!@site/../../../examples/node-api/node-script.js'
88
import Code from '@theme/CodeBlock'
99

1010
:::note Work-in-progress
@@ -15,6 +15,6 @@ These docs are incomplete. Check out the [examples directory](https://github.com
1515

1616
**bud.js** can be imported and instantiated directly.
1717

18-
<Code language="typescript" title="examples/node-api/01-simple.js">
18+
<Code language="typescript" title="examples/node-api/node-script.js">
1919
{NodeAPI}
2020
</Code>

sources/@roots/entrypoints-webpack-plugin/src/webpack.plugin.ts

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -119,30 +119,16 @@ export class EntrypointsWebpackPlugin {
119119
EntrypointsWebpackPlugin.getCompilationHooks(compilation)
120120
hooks.compilation.call(compilation)
121121

122-
const cache = compilation.getCache(this.constructor.name)
123-
this.entrypoints = await cache.getPromise<Entrypoints>(
124-
`entrypoints`,
125-
null,
126-
)
127-
128-
if (!this.entrypoints) {
129-
this.entrypoints = new Map()
122+
this.entrypoints = new Map()
130123

131-
for (const entry of compilation.entrypoints.values()) {
132-
this.getChunkedFiles(entry.chunks).map(({file}) => {
133-
const ident = entry.name
134-
const path = this.options.publicPath.concat(file)
135-
const type = path.split(`.`).pop()
124+
for (const entry of compilation.entrypoints.values()) {
125+
this.getChunkedFiles(entry.chunks).map(({file}) => {
126+
const ident = entry.name
127+
const path = this.options.publicPath.concat(file)
128+
const type = path.split(`.`).pop()
136129

137-
this.addToManifest({ident, path, type})
138-
})
139-
}
140-
141-
await cache.storePromise(
142-
`entrypoints`,
143-
null,
144-
this.entrypoints,
145-
)
130+
this.addToManifest({ident, path, type})
131+
})
146132
}
147133

148134
this.entrypoints = hooks.entrypoints.call(this.entrypoints)

0 commit comments

Comments
 (0)