Files
supabase/apps/www/internals/fix-contentlayer-bug.mjs
T
Francesco Sansalvadore b88adfef46 fix contentlayer build errors (#26822)
* move contentlayer/generated order in tsconfig

* temporarily fix contentLayer build bug

* temporarily fix contentLayer build bug

* temporarily fix contentLayer build bug

* revert dep update

* contentLayer

* revert contentLayer tsconfig change

* contentLayer postbuild

* update contentLayer script path

* change directory in content:fix www script

* content:fix in turbo package.json

* n_modules

* edit node_modules from script

* remove sitemap gen

* remove tsconfig change

* remove package.json change
2024-05-30 16:12:54 +08:00

30 lines
811 B
JavaScript

import fs from 'fs'
import path from 'path'
// Path to the package within the global node_modules
const packagePath = path.resolve(process.cwd(), '../../node_modules/@contentlayer2')
// Path to the specific file you want to modify
const filePath = path.join(packagePath, 'core', 'dist', 'getConfig', 'index.js')
// Read the file
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) {
console.error(`Error reading file: ${err}`)
return
}
// Modify the file content
let modifiedContent = data.replace('../../../../', '../../../')
// Write the modified content back to the file
fs.writeFile(filePath, modifiedContent, 'utf8', (err) => {
if (err) {
console.error(`Error writing file: ${err}`)
return
}
console.log('fix-contentlayer-bug was successfull')
})
})