Skip to content

Commit

Permalink
docs: mention more breaking changes from vitejs#7537
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed May 31, 2022
1 parent cfc37ac commit 75a1c2a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/guide/migration.md
Expand Up @@ -45,9 +45,26 @@ If using ESM for SSR isn't possible in your project, you can set `ssr.format: 'c

## General Changes

- JS file extensions in SSR and lib mode now use a valid extension (`js`, `mjs`, or `cjs`) for output JS entries and chunks based on their format and the package type.

### `import.meta.glob`

- [Raw `import.meta.glob`](features.md#glob-import-as) switched from `{ assert: { type: 'raw' }}` to `{ as: 'raw' }`
- Keys of `import.meta.glob` are now relative to the current module.

- JS file extensions in SSR and lib mode now use a valid extension (`js`, `mjs`, or `cjs`) for output JS entries and chunks based on their format and the package type.
```diff
// file: /foo/index.js
const modules = import.meta.glob('../foo/*.js')

// transformed:
const modules = {
- '../foo/bar.js': () => {}
+ './bar.js': () => {}
}
```

- When using an alias with `import.meta.glob`, the keys are always absolute.
- `import.meta.globEager` is now deprecated. Use `import.meta.glob('*', { eager: true })` instead.

## Migration from v1

Expand Down

0 comments on commit 75a1c2a

Please sign in to comment.