Use a module bundler

If you’re using a bundler like Webpack, MOD.UK Frontend components can be initialised as part of your bundle.

import { initAll } from '@moduk/frontend/client'

initAll()

If that does not work, import initAll from @moduk/frontend/dist/client/moduk-frontend.umd.js.

Remember to check that interactive components still work correctly, for example the accordion.

Using TypeScript

If you’re using this in a TypeScript project, you will need to skip type-checking on the library:

// @ts-expect-error @moduk/frontend does not include type definitions
import * as moduk from '@moduk/frontend/client'