1
0
Fork 0

fix(org): Fix prebuild to output mjs

This commit is contained in:
joostdecock 2023-02-05 16:39:18 +01:00
parent 1bd908d2c0
commit 8634b84e04
2 changed files with 5 additions and 6 deletions

View file

@ -2,10 +2,10 @@ import { useState } from 'react'
import get from 'lodash.get' import get from 'lodash.get'
import set from 'lodash.set' import set from 'lodash.set'
// Stores state in local storage // Stores state in local storage
import useLocalStorage from 'shared/hooks/useLocalStorage.js' import { useLocalStorage } from 'shared/hooks/useLocalStorage.mjs'
import useTheme from 'shared/hooks/useTheme' import { useTheme } from 'shared/hooks/useTheme.mjs'
// Prebuild navigation // Prebuild navigation
import prebuildNavigation from 'site/prebuild/navigation.js' import { prebuildNavigation } from 'site/prebuild/navigation.mjs'
// Translation // Translation
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'

View file

@ -5,7 +5,6 @@ import set from 'lodash.set'
// Some arbitrary future time // Some arbitrary future time
const future = new Date('10-12-2026').getTime() const future = new Date('10-12-2026').getTime()
/* /*
* Main method that does what needs doing * Main method that does what needs doing
*/ */
@ -46,8 +45,8 @@ export const prebuildNavigation = (mdxPages, strapiPosts, site) => {
} }
} }
fs.writeFileSync( fs.writeFileSync(
path.resolve('..', site, 'prebuild', `navigation.js`), path.resolve('..', site, 'prebuild', `navigation.mjs`),
`export default ${JSON.stringify(nav, null ,2)}` `export const prebuildNavigation = ${JSON.stringify(nav, null, 2)}`
) )
return true return true