···4242| --- | --- | --- | --- |
4343| `packages` | `Array<string \| RegExp>` | `[/^(?:vue$\|@vue\/)/]` | Packages to extract into COS chunks. |
44444545+## Trying it out
4646+4747+The module is a no-op in dev, so test a production build:
4848+4949+```bash
5050+nuxt build && nuxt preview
5151+```
5252+5353+What to look for:
5454+5555+- In `.output/public/_nuxt/`, the managed packages are emitted as content-hashed chunks (64-character hex filenames like `a1b2c3...e4f5.js`).
5656+- View source on the rendered page: Nuxt's default entry `<script type="module">` is gone, replaced by a `<script id="cos-loader">` containing the loader and an inlined manifest.
5757+- The page still hydrates and is interactive.
5858+5959+Without a COS-capable browser the loader fetches each chunk over the network (the fallback path), so this confirms the chunking and loader work, but not sharing.
6060+6161+To see real Cross-Origin Storage, install the [extension](https://chromewebstore.google.com/detail/cross-origin-storage/denpnpcgjgikjpoglpjefakmdcbmlgih), open the preview URL once (the chunks are fetched and stored), then reload or open another site shipping the same Vue version: in DevTools -> Network the hashed chunks are served from the shared store instead of refetched.
6262+4563## Browser support
46644765The [Cross-Origin Storage API](https://github.com/WICG/cross-origin-storage) is not yet in any browser. You can try it with the [Cross-Origin Storage browser extension](https://github.com/web-ai-community/cross-origin-storage-extension). Without it, chunks load over the network as usual, so your site keeps working; it just doesn't share them.
···42424343For a plain client build, the plugin injects the loader into `index.html` and removes the default entry `<script>` automatically.
44444545+## Trying it out
4646+4747+The plugin only runs at build time, so verify against a production build, not the dev server:
4848+4949+```bash
5050+vite build && vite preview
5151+```
5252+5353+Then check, in your `dist/<assetsDir>/`, that the managed packages are emitted as content-hashed chunks (a 64-character hex filename like `a1b2c3...e4f5.js`), and that opening the preview URL still loads the app normally. The chunks import each other by `cos1:<hash>` specifiers, resolved at runtime through an injected `<script type="importmap">`.
5454+5555+Without a COS-capable browser the loader fetches each chunk over the network, so this is the network-fallback path: it confirms the chunking and loader work, but not sharing.
5656+5757+To see real Cross-Origin Storage, install the [extension](https://chromewebstore.google.com/detail/cross-origin-storage/denpnpcgjgikjpoglpjefakmdcbmlgih), then:
5858+5959+1. Open the preview URL. On the first load the chunks are fetched and stored in COS (the extension's toolbar popup shows the activity).
6060+2. Reload, or open a **different** site that ships the same dependency at the same version. In DevTools -> Network, the managed hashed `.js` chunks are no longer fetched; they come from the shared store instead.
6161+4562## Options
46634764| Option | Type | Default | Description |