Skip to content

🎥 Make videos programmatically with React

Fix Docusaurus caching

Jonny Burgerbe034b931949
diff --git a/packages/docusaurus-plugin/src/caching.ts b/packages/docusaurus-plugin/src/caching.ts
index ff2e69d947..41ccaa411e 100644
--- a/packages/docusaurus-plugin/src/caching.ts
+++ b/packages/docusaurus-plugin/src/caching.ts
@@ -40,33 +40,12 @@ export const cachedTwoslashCall = (
.digest('hex');
const getNmCache = () => {
- if (__dirname.includes('node_modules')) {
- return join(
- __dirname.split('node_modules')[0],
- 'node_modules',
- '.cache',
- 'twoslash',
- );
- }
-
- return join(__dirname, '..', '..', '.cache', 'twoslash');
- };
-
- const getPnpCache = () => {
- try {
- const pnp = require('pnpapi');
- return join(
- pnp.getPackageInformation(pnp.topLevel).packageLocation,
- 'node_modules',
- '.cache',
- 'twoslash',
- );
- } catch (error) {
- return getNmCache();
- }
+ const p = join(process.cwd(), 'node_modules', '.cache', 'twoslash');
+ console.log(p);
+ return p;
};
- const cacheRoot = process.versions.pnp ? getPnpCache() : getNmCache();
+ const cacheRoot = getNmCache();
const cachePath = join(cacheRoot, `${codeSha}.json`);
diff --git a/turbo.json b/turbo.json
index 87446b05b8..e205cfab16 100644
--- a/turbo.json
+++ b/turbo.json
@@ -17,12 +17,7 @@
},
"build-docs": {
"dependsOn": ["^make", "make"],
- "outputs": [
- ".docusaurus/**",
- "../../node_modules/.cache/twoslash/**",
- "build/**",
- "./node_modules/.cache/**"
- ]
+ "outputs": [".docusaurus/**", "build/**", "./node_modules/.cache/**"]
},
"test": {
"dependsOn": ["^make", "make"],