From 5973df1e961419e182bafafb6ae9f69457323a55 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Wed, 14 Sep 2022 19:26:43 +0200 Subject: [PATCH] chore: update examples to `^3.0.0-rc.10` and use global `defineNuxtConfig` (#7515) --- docs/content/1.getting-started/4.assets.md | 4 - docs/content/1.getting-started/9.testing.md | 1 - docs/content/2.guide/1.concepts/7.esm.md | 4 - .../2.directory-structure/1.components.md | 7 +- .../2.directory-structure/1.content.md | 2 - .../2.guide/2.directory-structure/1.pages.md | 2 - .../2.guide/2.directory-structure/1.server.md | 4 - .../2.directory-structure/3.nuxt.config.md | 15 +- docs/content/bridge/1.overview.md | 3 - docs/content/migration/2.configuration.md | 4 - docs/content/migration/8.runtime-config.md | 4 +- docs/yarn.lock | 179 ++++++++---------- .../config-extends/base/nuxt.config.ts | 2 - .../advanced/config-extends/nuxt.config.ts | 2 - examples/advanced/config-extends/package.json | 2 +- .../advanced/config-extends/ui/nuxt.config.ts | 2 - examples/advanced/jsx/nuxt.config.ts | 2 - examples/advanced/jsx/package.json | 2 +- .../module-extend-pages/nuxt.config.ts | 2 - .../advanced/module-extend-pages/package.json | 2 +- examples/advanced/testing/nuxt.config.ts | 2 - examples/advanced/testing/package.json | 2 +- examples/app-config/nuxt.config.ts | 2 - examples/app-config/package.json | 2 +- examples/app/error-handling/nuxt.config.ts | 2 - examples/app/error-handling/package.json | 2 +- examples/app/plugins/nuxt.config.ts | 2 - examples/app/plugins/package.json | 2 +- examples/app/teleport/nuxt.config.ts | 2 - examples/app/teleport/package.json | 2 +- .../auto-imports/components/nuxt.config.ts | 2 - examples/auto-imports/components/package.json | 2 +- .../auto-imports/composables/nuxt.config.ts | 2 - .../auto-imports/composables/package.json | 2 +- .../composables/use-async-data/nuxt.config.ts | 2 - .../composables/use-async-data/package.json | 2 +- .../composables/use-cookie/nuxt.config.ts | 2 - examples/composables/use-cookie/package.json | 2 +- examples/composables/use-fetch/nuxt.config.ts | 2 - examples/composables/use-fetch/package.json | 2 +- examples/composables/use-head/nuxt.config.ts | 2 - examples/composables/use-head/package.json | 2 +- examples/composables/use-state/nuxt.config.ts | 2 - examples/composables/use-state/package.json | 2 +- .../essentials/hello-world/nuxt.config.ts | 2 - examples/essentials/hello-world/package.json | 2 +- .../reactivity-transform/nuxt.config.ts | 2 - .../reactivity-transform/package.json | 2 +- .../experimental/vite-node/nuxt.config.ts | 2 - examples/experimental/vite-node/package.json | 2 +- examples/experimental/wasm/nuxt.config.ts | 2 - examples/experimental/wasm/package.json | 2 +- examples/other/locale/nuxt.config.ts | 2 - examples/other/locale/package.json | 2 +- examples/routing/layouts/nuxt.config.ts | 2 - examples/routing/layouts/package.json | 2 +- examples/routing/middleware/nuxt.config.ts | 2 - examples/routing/middleware/package.json | 2 +- examples/routing/nuxt-link/nuxt.config.ts | 2 - examples/routing/nuxt-link/package.json | 2 +- examples/routing/pages/nuxt.config.ts | 2 - examples/routing/pages/package.json | 2 +- .../routing/universal-router/nuxt.config.ts | 2 - .../routing/universal-router/package.json | 2 +- examples/server/routes/nuxt.config.ts | 2 - examples/server/routes/package.json | 2 +- .../fixtures/basic/extends/bar/nuxt.config.ts | 2 - test/fixtures/basic/nuxt.config.ts | 1 - yarn.lock | 62 +++--- 69 files changed, 152 insertions(+), 250 deletions(-) diff --git a/docs/content/1.getting-started/4.assets.md b/docs/content/1.getting-started/4.assets.md index b98a4f668e9..e89c9f88c71 100644 --- a/docs/content/1.getting-started/4.assets.md +++ b/docs/content/1.getting-started/4.assets.md @@ -70,8 +70,6 @@ In your `nuxt.config` ::code-group ```ts [SCSS] -import { defineNuxtConfig } from 'nuxt' - export default defineNuxtConfig({ vite: { css: { @@ -86,8 +84,6 @@ export default defineNuxtConfig({ ``` ```ts [SASS] -import { defineNuxtConfig } from 'nuxt' - export default defineNuxtConfig({ vite: { css: { diff --git a/docs/content/1.getting-started/9.testing.md b/docs/content/1.getting-started/9.testing.md index dd8a037cb76..2fae519c324 100644 --- a/docs/content/1.getting-started/9.testing.md +++ b/docs/content/1.getting-started/9.testing.md @@ -148,7 +148,6 @@ To test the modules we create, we could set up some Nuxt apps as fixtures and te ```ts // nuxt.config.js -import { defineNuxtConfig } from 'nuxt' import MyModule from '../../src' export default defineNuxtConfig({ diff --git a/docs/content/2.guide/1.concepts/7.esm.md b/docs/content/2.guide/1.concepts/7.esm.md index 7ac6b10d29d..752814fb66e 100644 --- a/docs/content/2.guide/1.concepts/7.esm.md +++ b/docs/content/2.guide/1.concepts/7.esm.md @@ -117,8 +117,6 @@ If you encounter these errors, the issue is almost certainly with the upstream l In the meantime, you can tell Nuxt not to try to import these libraries by adding them to `build.transpile`: ```js -import { defineNuxtConfig } from 'nuxt' - export default defineNuxtConfig({ build: { transpile: ['sample-library'] @@ -133,8 +131,6 @@ You may find that you _also_ need to add other packages that are being imported In some cases, you may also need to manually alias the library to the CJS version, for example: ```js -import { defineNuxtConfig } from 'nuxt' - export default defineNuxtConfig({ alias: { 'sample-library': 'sample-library/dist/sample-library.cjs.js' diff --git a/docs/content/2.guide/2.directory-structure/1.components.md b/docs/content/2.guide/2.directory-structure/1.components.md index f74e63a3660..2466d2f9629 100644 --- a/docs/content/2.guide/2.directory-structure/1.components.md +++ b/docs/content/2.guide/2.directory-structure/1.components.md @@ -70,7 +70,6 @@ If you are using `resolveComponent` to handle dynamic components, make sure not Alternatively, though not recommended, you can register all your components globally, which will create async chunks for all your components and make them available throughout your application. ```diff - import { defineNuxtConfig } from 'nuxt' export default defineNuxtConfig({ components: { @@ -187,7 +186,7 @@ Make sure not to _nest_ `` components or other client-only component If a component is meant to be rendered only client-side, you can add the `.client` suffix to your component. ```bash -| components/ +| components/ --| Comments.client.vue ``` @@ -209,14 +208,14 @@ This feature only works with Nuxt auto-imports. Explicitly importing these compo `.server` components are fallback components of `.client` components. ```bash -| components/ +| components/ --| Comments.client.vue --| Comments.server.vue ``` ```html{}[pages/example.vue]