Skip to content

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, css and assets are built
  • vite build --mode development - development build, pages, js, css and assets are built
  • vite build --mode emails - emails build, only email templates and email styles 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'

input ​

Determines which input paths are used for assets, pages and emails.

codeSplitting ​

Determines code splitting groups used for non-email builds.

vituum ​

See Vituum for more info about options.

css ​

  • Type: Object
  • Default: { transformer: 'lightningcss', lightningcss: {} }

Determines CSS processing options.

cssInline ​

  • Type: Object
  • Default: { paths: ['src/pages/email'], postcss: {} }

Determines CSS inline options for email templates.

tailwindcss ​

  • Type: Object
  • Default: {}

See Tailwind CSS for more info about options.

send ​

  • Type: Object
  • Default: {}

See Vituum for more info about options.

latte ​

See Vituum for more info about options.

twig ​

  • Type: Object
  • Default: {}

See Twig plugin for more info about options.

heroicons ​

Determines icons generation options.

Default iconSets:

js
{
  'simpleicons-solid': [simpleIcons, 'src/icons/simpleicons'],
  'icons-solid': [solidIcons, 'src/icons/solid'],
  'icons-outline': 'src/icons/outline',
}

Bundled icons are available in the core icons directory.

Released under the MIT License.