Skip to content

Commit c5bdec0

Browse files
authored
fix(templates): put back args to watch in dev (#4033)
1 parent 87a7828 commit c5bdec0

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

build.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default defineBuildConfig({
1111
delimiters: ['', ''],
1212
values: {
1313
// Used in development to import directly from theme
14-
'const isUiDev = true': 'const isUiDev = false'
14+
'process.argv.includes(\'--uiDev\')': 'false'
1515
}
1616
}
1717
},

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@
9696
"scripts": {
9797
"build": "nuxt-module-build build",
9898
"prepack": "pnpm build",
99-
"dev": "nuxi dev playground",
99+
"dev": "nuxi dev playground --uiDev",
100100
"dev:build": "nuxi build playground",
101-
"dev:vue": "vite playground-vue",
101+
"dev:vue": "vite playground-vue -- --uiDev",
102102
"dev:vue:build": "vite build playground-vue",
103103
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground && nuxi prepare docs && vite build playground-vue",
104-
"docs": "nuxi dev docs",
104+
"docs": "nuxi dev docs --uiDev",
105105
"docs:build": "nuxi build docs",
106106
"docs:prepare": "nuxt-component-meta docs",
107107
"lint": "eslint .",

src/templates.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export function getTemplates(options: ModuleOptions, uiConfig: Record<string, an
5151
}
5252

5353
// For local development, import directly from theme
54-
const isUiDev = true
55-
if (isUiDev) {
54+
if (process.argv.includes('--uiDev')) {
5655
const templatePath = fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url))
5756
return [
5857
`import template from ${JSON.stringify(templatePath)}`,

0 commit comments

Comments
 (0)