Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
31 captures
22 Dec 2022 - 11 Sep 2025
JunJULAug
06
202220232024
success
fail
COLLECTED BY
Organization:Archive Team
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.

The main site for Archive Team is atarchiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.

This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by theWayback Machine, providing a path back to lost websites and work.

Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.

The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.

TIMESTAMPS
loading
The Wayback Machine - http://web.archive.org/web/20230706035858/https://nuxt.com/docs/guide/going-further/layers
✨ Discover our official Nuxt Training Courses.Learn more

Authoring Nuxt Layers

Nuxt layers are a powerful feature that you can use to share and reuse partial Nuxt applications within a monorepo, or from a git repository or npm package. The layers structure is almost identical to a standard Nuxt application, which makes them easy to author and maintain. (Read More)

A minimal Nuxt layer directory should contain anuxt.config.ts file to indicate it is a layer.

base/nuxt.config.ts
exportdefaultdefineNuxtConfig({})

Additionally, certain other files in the layer directory will be auto-scanned and used by Nuxt for the project extending this layer.

  • components/* - Extend the default components
  • composables/* - Extend the default composables
  • pages/* - Extend the default pages
  • server/* - Extend the default server endpoints & middleware
  • nuxt.config.ts - Extend the default nuxt config
  • app.config.ts - Extend the default app config

Basic Example

nuxt.config.ts
exportdefaultdefineNuxtConfig({extends: ['./base'  ]})
app.vue
  <template>    <BaseComponent/>  </template>
base/nuxt.config.ts
exportdefaultdefineNuxtConfig({// Extending from base nuxt.config.ts!app: {head: {title:'Extending Configs is Fun!',meta: [          {name:'description',content:'I am using the extends feature in nuxt 3!' }        ],      }    }})
base/components/BaseComponent.vue
  <template>    <h1>Extending Components is Fun!</h1>  </template>

If you're interested in deepening your understanding about layers, consider examininga fully fleshed outnuxt.config.ts file on the Docus platform.

Starter Template

To get started you can initialize a layer with thenuxt/starter/layer template. This will create a basic structure you can build upon. Execute this command within the terminal to get started:

npxnuxiinit--templatelayernuxt-layer

Follow up on the README instructions for the next steps.

Checknuxt-themes/starter for a more opinionated starter for authoring Nuxt themes. It can be initialized with:

npxnuxiinit--templategh:nuxt-themes/startermy-theme

Publishing Layers

You can publish and share layers by either using a remote source or an npm package.

Git Repository

You can use a git repository to share your Nuxt layer. Some examples:

nuxt.config.ts
exportdefaultdefineNuxtConfig({extends: ['github:username/repoName',// GitHub Remote Source'github:username/repoName/base',// GitHub Remote Source within /base directory'github:username/repoName#dev',// GitHub Remote Source from dev branch'github:username/repoName#v1.0.0',// GitHub Remote Source from v1.0.0 tag'gitlab:username/repoName',// GitLab Remote Source example'bitbucket:username/repoName',// Bitbucket Remote Source example  ]})

If you want to extend a private remote source, you need to add the environment variableGIGET_AUTH=<token> to provide a token.

Currently, with git remote sources, if a layer has npm dependencies, you will need to manually install them in the target project. We are working on this to auto-install layer dependencies with git sources.

npm Package

You can publish Nuxt layers as an npm package that contains the files and dependencies you want to extend. This allows you to share your config with others, use it in multiple projects or use it privately.

To extend from an npm package, you need to make sure that the module is published to npm and installed in the user's project as a devDependency. Then you can use the module name to extend the current nuxt config:

nuxt.config.ts
exportdefaultdefineNuxtConfig({extends: [// Node Module with scope'@scope/moduleName',// or just the module name'moduleName'  ]})

To publish a layer directory as an npm package, you want to make sure that thepackage.json has the correct properties filled out. This will make sure that the files are included when the package is published.

package.json
{"name":"my-theme","version":"1.0.0","type":"module","main":"./nuxt.config.ts","dependencies": {},"devDependencies": {"nuxt":"^3.0.0"  }}

Make sure any dependency imported in the layer isexplicitly added to thedependencies. Thenuxt dependency, and anything only used for testing the layer before publishing, should remain in thedevDependencies field.

Now you can proceed to publish the module to npm, either publicly or privately.

When publishing the layer as a private npm package, you need to make sure you log in, to authenticate with npm to download the node module.

Tips

Relative Paths and Aliases

When importing using aliases (such as~/ and@/) in a layer components and composables, note that aliases are resolved relative to the user's project paths. As a workaround, you canuse relative paths to import them. We are working on a better solution for named layer aliases.

Also when using relative paths innuxt.config file of a layer, (with exception of nestedextends) they are resolved relative to user's project instead of the layer. As a workaround, use full resolved paths innuxt.config:

nuxt.config.ts
import {fileURLToPath }from'url'import {dirname,join }from'path'constcurrentDir=dirname(fileURLToPath(import.meta.url))exportdefaultdefineNuxtConfig({css: [join(currentDir,'./assets/main.css')  ]})

Multi-Layer Support for Nuxt Modules

You can use the internal arraynuxt.options._layers to support custom multi-layer handling for your modules.

Example:

modules/my-module.ts
exportdefaultdefineNuxtModule({setup(_options,nuxt){for (constlayerofnuxt.options._layers) {// You can check for a custom directory existence to extend for each layerconsole.log('Custom extension for',layer.cwd,layer.config)    }  }})

Notes:

  • Earlier items in the_layers array have higher priority and override later ones
  • The user's project is the first item in the_layers array

Going Deeper

Configuration loading and extends support is handled byunjs/c12, merged usingunjs/defu and remote git sources are supported usingunjs/giget. Check the docs and source code to learn more.

We are working to bring more improvements for layers support. Please refer tonuxt/nuxt#13367.


[8]ページ先頭

©2009-2025 Movatter.jp