diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a53fb3..ff544e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: - name: Install run: pnpm install - # Required for svelte-check - name: Build run: pnpm --filter=./packages/unlazy run build diff --git a/packages/nuxt/.nuxtrc b/packages/nuxt/.nuxtrc new file mode 100644 index 0000000..2d24bc6 --- /dev/null +++ b/packages/nuxt/.nuxtrc @@ -0,0 +1 @@ +future.typescriptBundlerResolution=true diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 151905d..8a88afc 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -41,7 +41,7 @@ "prepack": "nuxt-module-build build", "dev": "nuxi dev playground", "dev:build": "nuxi build playground", - "dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground", + "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground", "test:types": "vue-tsc --noEmit" }, "dependencies": { diff --git a/packages/nuxt/playground/nuxt.config.ts b/packages/nuxt/playground/nuxt.config.ts index a5f1850..310a8b8 100644 --- a/packages/nuxt/playground/nuxt.config.ts +++ b/packages/nuxt/playground/nuxt.config.ts @@ -24,18 +24,11 @@ export default defineNuxtConfig({ }, }, + future: { + typescriptBundlerResolution: true, + }, + typescript: { shim: false, - tsConfig: { - compilerOptions: { - moduleResolution: 'bundler', - paths: { - '@unlazy/core': ['../../core/src/index.ts'], - '@unlazy/core/*': ['../../core/src/*'], - 'unlazy': ['../../unlazy/src/index.ts'], - 'unlazy/*': ['../../unlazy/src/*'], - }, - }, - }, }, }) diff --git a/packages/nuxt/playground/tsconfig.json b/packages/nuxt/playground/tsconfig.json new file mode 100644 index 0000000..4b34df1 --- /dev/null +++ b/packages/nuxt/playground/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./.nuxt/tsconfig.json" +} diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index 7b838e0..5c83346 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -42,7 +42,7 @@ export default defineNuxtModule({ // Add module options to public runtime config nuxt.options.runtimeConfig.public.unlazy = defu( - // @ts-expect-error: Maybe not defined + // @ts-expect-error: Can be unknown nuxt.options.runtimeConfig.public.unlazy, options, ) @@ -51,7 +51,7 @@ export default defineNuxtModule({ nuxt.options.build.transpile.push(resolve('runtime')) extendViteConfig((config) => { - config.define = config.define || {} + config.define ||= {} config.define.__UNLAZY_HASH_DECODING__ = true }) diff --git a/packages/nuxt/tsconfig.json b/packages/nuxt/tsconfig.json index d0a2316..6e6ab83 100644 --- a/packages/nuxt/tsconfig.json +++ b/packages/nuxt/tsconfig.json @@ -1,4 +1,4 @@ { - "extends": "./playground/.nuxt/tsconfig.json", - "include": ["src", "playground"] + "extends": "./.nuxt/tsconfig.json", + "include": ["src"] }