fix(org): Fix prebuild to output mjs
This commit is contained in:
parent
1bd908d2c0
commit
8634b84e04
2 changed files with 5 additions and 6 deletions
|
@ -2,10 +2,10 @@ import { useState } from 'react'
|
|||
import get from 'lodash.get'
|
||||
import set from 'lodash.set'
|
||||
// Stores state in local storage
|
||||
import useLocalStorage from 'shared/hooks/useLocalStorage.js'
|
||||
import useTheme from 'shared/hooks/useTheme'
|
||||
import { useLocalStorage } from 'shared/hooks/useLocalStorage.mjs'
|
||||
import { useTheme } from 'shared/hooks/useTheme.mjs'
|
||||
// Prebuild navigation
|
||||
import prebuildNavigation from 'site/prebuild/navigation.js'
|
||||
import { prebuildNavigation } from 'site/prebuild/navigation.mjs'
|
||||
// Translation
|
||||
import { useRouter } from 'next/router'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
|
|
@ -5,7 +5,6 @@ import set from 'lodash.set'
|
|||
// Some arbitrary future time
|
||||
const future = new Date('10-12-2026').getTime()
|
||||
|
||||
|
||||
/*
|
||||
* Main method that does what needs doing
|
||||
*/
|
||||
|
@ -46,8 +45,8 @@ export const prebuildNavigation = (mdxPages, strapiPosts, site) => {
|
|||
}
|
||||
}
|
||||
fs.writeFileSync(
|
||||
path.resolve('..', site, 'prebuild', `navigation.js`),
|
||||
`export default ${JSON.stringify(nav, null ,2)}`
|
||||
path.resolve('..', site, 'prebuild', `navigation.mjs`),
|
||||
`export const prebuildNavigation = ${JSON.stringify(nav, null, 2)}`
|
||||
)
|
||||
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue