@borngroup/lightswitch-nuxt-theme
v0.1.78
Published
Lightswitch core project - default nuxt project theme
Downloads
24
Readme
Nuxt Theme Module
This module is basically our default theme on steroids. It contains additional utilities that make it easier to work with the theme (in projects and as core developers) and allows to disable parts of its features:
- By default, it adds eCommerce routes to your app.
- If you set
generate
in the config, it will copy, merge & watch for changes in agnostic and integration theme.
How to install
Add dependency:
yarn add @borngroup/lightswitch-nuxt-theme
Add it to buildModules
in your nuxt.config.js
:
['@borngroup/lightswitch-nuxt-theme'],
Configuration details
routes
If you want to disable autoadding routes you can do it:
['@borngroup/lightswitch-nuxt-theme', {
routes: false
}],
generate
To properly configure generate
property you have to provide data that will be replaced in EJS templates. This property applies only to the core development:
['@borngroup/lightswitch-nuxt-theme', {
generate: {
replace: {
apiClient: '@borngroup/lightswitch-commercetools-api',
composables: '@lightswitch/commercetools'
}
}
}],
Example EJS template where it will be pasted:
import { useCategory } from '<%= options.generate.replace.composables %>';
If you want to change the target directory where agnostic and integration themes will be merged and copied during core development change the generate.path
property (default: _theme
):
['@borngroup/lightswitch-nuxt-theme', {
generate: {
path: '.custom-dir'
}
}],