1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-21 23:37:55 +00:00
bramw_baserow/web-frontend/modules/builder/module.js
2024-03-26 14:37:13 +00:00

44 lines
1.3 KiB
JavaScript

import path from 'path'
import { routes } from './routes'
import en from './locales/en.json'
import fr from './locales/fr.json'
import nl from './locales/nl.json'
import de from './locales/de.json'
import it from './locales/it.json'
import es from './locales/es.json'
import pl from './locales/pl.json'
export default function BuilderModule(options) {
this.addPlugin({ src: path.resolve(__dirname, 'middleware.js') })
// Add the plugin to register the builder application.
this.appendPlugin({
src: path.resolve(__dirname, 'plugin.js'),
})
// Override the existing generated Nuxt router.js file, so that we can change the
// router by our own.
this.addPlugin({
src: path.resolve(__dirname, 'plugins/router.js'),
fileName: 'router.js',
})
this.addPlugin({ src: path.resolve(__dirname, 'plugins/global.js') })
// Create a "fake" template with the existing Nuxt router file that can be used by the
// `plugins/router.js` above.
this.addTemplate({
fileName: 'defaultRouter.js',
src: require.resolve('@nuxt/vue-app/template/router'),
})
// Add all the related routes.
this.extendRoutes((configRoutes) => {
configRoutes.push(...routes)
})
this.nuxt.hook('i18n:extend-messages', function (additionalMessages) {
additionalMessages.push({ en, fr, nl, de, it, es, pl })
})
}