From fb4c210b41af0ca80827df793fec4d2de660fee3 Mon Sep 17 00:00:00 2001 From: Sandro Circi Date: Thu, 10 Apr 2025 15:59:04 +0200 Subject: [PATCH] chore: simplify theme imports in dev (#3851) --- build.config.ts | 3 ++- package.json | 6 +++--- src/templates.ts | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build.config.ts b/build.config.ts index c3d7c4cc..1cacdf24 100644 --- a/build.config.ts +++ b/build.config.ts @@ -10,7 +10,8 @@ export default defineBuildConfig({ replace: { delimiters: ['', ''], values: { - 'process.argv.at(-1) === \'--uiDev\'': 'false' + // Used in development to import directly from theme + 'const isUiDev = true': 'const isUiDev = false' } } }, diff --git a/package.json b/package.json index 60ca44be..b7cad50b 100644 --- a/package.json +++ b/package.json @@ -96,12 +96,12 @@ "scripts": { "build": "nuxt-module-build build", "prepack": "pnpm build", - "dev": "nuxi dev playground --uiDev", + "dev": "nuxi dev playground", "dev:build": "nuxi build playground", - "dev:vue": "vite playground-vue -- --uiDev", + "dev:vue": "vite playground-vue", "dev:vue:build": "vite build playground-vue", "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs && vite build playground-vue", - "docs": "nuxi dev docs --uiDev", + "docs": "nuxi dev docs", "docs:build": "nuxi build docs", "docs:prepare": "nuxt-component-meta docs", "lint": "eslint .", diff --git a/src/templates.ts b/src/templates.ts index e4578cfb..6a43d34a 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -50,12 +50,13 @@ export function getTemplates(options: ModuleOptions, uiConfig: Record