From c9d7e8cad4ed5b28255c5286dfb933dc50724e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yae=CC=88l=20GUILLOUX?= Date: Mon, 24 May 2021 12:12:58 +0200 Subject: [PATCH] :pencil: (theme) update comments --- src/defaultTheme/module.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/defaultTheme/module.ts b/src/defaultTheme/module.ts index c433a9d3d..87dca1d6a 100644 --- a/src/defaultTheme/module.ts +++ b/src/defaultTheme/module.ts @@ -7,8 +7,8 @@ import { Module, NuxtOptions } from '@nuxt/types' import gracefulFs from 'graceful-fs' import clearModule from 'clear-module' import jiti from 'jiti' -import defaultWindiConfig from './windi.config' import fg from 'fast-glob' +import defaultWindiConfig from './windi.config' const r = (...args: string[]) => resolve(__dirname, ...args) @@ -60,24 +60,26 @@ export default function themeSetupModule() { // Merge user and theme Windi configs windiOptions.config = defu.arrayFn(windiOptions.config || {}, localWindiConfig || {}, defaultWindiConfig) - const transformFiles = await fg( - '**/*.{vue,css}', - { - cwd: join(options.rootDir, '/node_modules/docus/dist'), - onlyFiles: true, - absolute: true, - }, - ) - // make sure file @apply's get transformed + // Glob grabbing all Docus files + const transformFiles = await fg('**/*.{vue,css}', { + cwd: join(options.rootDir, '/node_modules/docus/dist'), + onlyFiles: true, + absolute: true + }) + + // Make sure file @apply's get transformed windiOptions.scanOptions.extraTransformTargets = { - css: transformFiles.filter((f : string) => f.endsWith('.css')), - detect: transformFiles.filter((f : string) => f.endsWith('.vue')) + css: transformFiles.filter((f: string) => f.endsWith('.css')), + detect: transformFiles.filter((f: string) => f.endsWith('.vue')) } + // Trailing glob used for includes const glob = '/**/*.{html,vue,md,mdx,pug,jsx,tsx,svelte,css}' + // Resolve admin runtime path const adminPath = join(__dirname, '../admin') + // Push every included path into scan options windiOptions.scanOptions.include.push( join(adminPath, glob), join(__dirname, glob),