Skip to content

Commit 92a893a

Browse files
committed
build: fixed playground
Couldn;t get tailwind to work in the playground because the @witchcraft/ui module it tries to import doesn't technically exist (unless working with my local monorepo). Using absolute paths for the style/base imports doesn't work either. Instead we link to the parent folder before building. This should work regardless of the environment used to build the package.
1 parent d4415ef commit 92a893a

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
"scripts": {
6969
"//prepare": "echo Needed so that if we pull the package from git it will get built and installed properly.",
7070
"prepare": "husky && pnpm gen:theme && pnpm build",
71-
"build": "nuxt-module-build prepare && nuxt-module-build build && nuxi generate playground",
71+
"build": "nuxt-module-build prepare && nuxt-module-build build && pnpm build:playground",
72+
"build:playground": "cd playground && pnpm link:module && pnpm generate",
7273
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
7374
"dev": "nuxi dev playground",
7475
"storybook": "BROWSER=none storybook dev -p 6006",

playground/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export default defineNuxtConfig({
55
compatibilityVersion: 4 as const
66
},
77
modules: [
8+
// "@witchcraft/ui/nuxt"
89
"../src/module"
9-
// "@witchcraft/ui/nuxt", // either work
1010
],
1111
witchcraftUi: {
1212
},

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"name": "@witchcraft/ui-playground",
44
"type": "module",
55
"scripts": {
6+
"link:module": "pnpm link ../",
67
"dev": "nuxi dev",
78
"build": "nuxi build",
89
"generate": "nuxi generate"
910
},
1011
"dependencies": {
11-
"@witchcraft/ui": "^0.0.0",
1212
"nuxt": "^3.16.2"
1313
}
1414
}

0 commit comments

Comments
 (0)