nova-ui/plugins/ipfs.ts
2022-12-04 07:02:30 +01:00

20 lines
438 B
TypeScript

import { Plugin } from '@nuxt/types'
import { getIPFSPrefix } from '@/utilities'
const ipfs: Plugin = ({ app }) => {
const ipfsPathPrefix = getIPFSPrefix()
if (ipfsPathPrefix) {
// @ts-expect-error
__webpack_public_path__ = ipfsPathPrefix + '/_nuxt/'
if (typeof window !== 'undefined') {
// @ts-expect-error
app.router.history.base = ipfsPathPrefix || window.location.host
}
}
}
export default ipfs