0.0.2 • Published 5 years ago
@nuxt/theme v0.0.2
@nuxt/theme
Add theme/extends support to Nuxt 2 projects!
Features
- Forward compatible with Nuxt 3 multi Apps
- Support nested
extends - Smartly merge config and hooks
- Allow theme development to be like a normal nuxt project
Usage
Common Setup
Install @nuxt/theme as a dependency:
# yarn
yarn add @nuxt/theme
# npm
npm i @nuxt/themeUpdate nuxt.config file:
import { resolveConfig } from '@nuxt/theme'
export default resolveConfig({
// Your actual Nuxt configuration
})Theme Consumer
Use extends key in nuxt.config:
import { resolveConfig } from '@nuxt/theme'
export default resolveConfig({
extends: '@nuxt/docs-theme',
})Theme Author
- Update
nuxt.configand ensure requiredrootDirandnameproperties are provided
import { resolveConfig } from '@nuxt/theme'
export default resolveConfig({
rootDir: __dirname,
name: 'myTheme',
}Note: If you are extending another theme, rootDir should be ONLY provided if you want to also extend project.
- Instead of using
~/or@/aliases, use~myThemeor@myTheme
License
MIT. Made with 💖