Skip to content
On this page

Configuring Newlogic Core

Newlogic Core needs to be added as a plugin in vite.config.js inside a project root.
You can also use .mjs, .ts, learn more about Vite config.

The most basic config file looks like this:

js
import core from '@newlogic-digital/core'

export default {
    plugins: [core()]
}

Commands

  • vite build - production build, only js and css files are built
  • vite build --mode development - development build, all files are built
  • vite build --mode emails - emails build, only email templates are built

Options

mode

  • Type: string
  • Default: null

Determines which build mode is used during build, possible values are 'development', 'production', 'emails'

cert

  • Type: string
  • Default: localhost

Certificate name located in .ssh/, eg. localhost-key.pem and localhost.pem. You can also turn off https by setting server.https to false in Vite config.

format

  • Type: string[]
  • Default: ['latte']

Determines which templates formats are used, possible values are 'latte' and 'twig'

emails.outputDir

  • Type: string
  • Default: 'public/email'

Determines location where email files are located after build.

emails.appDir

  • Type: string
  • Default: app/Templates/Emails

Determines where emails are copied after vite build --mode emails command execution.

vituum

  • Type: Object
  • Default: { pages: { dir: './src/views' } }

See Vituum for more info about options.

posthtml

  • Type: Object
  • Default: { root: resolve(process.cwd(), 'src') }

See Vituum for more info about options.

juice

  • Type: string[]
  • Default: ['src/views/email']

See Vituum for more info about options.

tailwindcss

  • Type: Object
  • Default: ['src/views/email']

See Vituum for more info about options.

send

See Vituum for more info about options.

latte

See Vituum for more info about options.

twig

See Vituum for more info about options.

Released under the MIT License.