feat(config): add plugins in config type
This commit is contained in:
parent
a3b42c5d7f
commit
d46bf2255b
2 changed files with 9 additions and 7 deletions
|
@ -1,19 +1,21 @@
|
||||||
import type { NitroConfig } from 'nitropack'
|
import type { NitroConfig } from 'nitropack'
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: fix types
|
|
||||||
* - plugins missing
|
|
||||||
*/
|
|
||||||
export type McFlyConfig = {
|
export type McFlyConfig = {
|
||||||
components: 'js' | 'lit'
|
components: 'js' | 'lit'
|
||||||
nitro?: NitroConfig
|
nitro?: NitroConfig
|
||||||
|
plugins?: McFlyPlugin[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the configuration for the McFly project
|
* Define the configuration for the McFly project
|
||||||
* @param {McFlyConfig} config
|
* @param {McFlyConfig} config
|
||||||
* @returns {function(): McFlyConfig}
|
* @returns {function(): McFlyConfig}e
|
||||||
*/
|
*/
|
||||||
export function defineMcFlyConfig(config: McFlyConfig) {
|
export function defineMcFlyConfig(config: McFlyConfig) {
|
||||||
return () => config
|
return () => config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: finalize Plugin type
|
||||||
|
*/
|
||||||
|
export type McFlyPlugin = {}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineMcFlyConfig } from '@mcflyjs/config'
|
import { defineMcFlyConfig } from '@mcflyjs/config'
|
||||||
import testPlugin from './test-plugin.mjs'
|
// import testPlugin from './test-plugin.mjs'
|
||||||
|
|
||||||
export default defineMcFlyConfig({
|
export default defineMcFlyConfig({
|
||||||
components: 'js',
|
components: 'js',
|
||||||
plugins: [testPlugin()],
|
// plugins: [testPlugin()],
|
||||||
nitro: {
|
nitro: {
|
||||||
preset: 'netlify',
|
preset: 'netlify',
|
||||||
devServer: {
|
devServer: {
|
||||||
|
|
Loading…
Reference in a new issue