rsnext/packages/next-swc
Shu Ding f1240b8efd
Refactor next-font-manifest-plugin (#51835)
## Background

Currently we're track all imported CSS modules by an entry, in the
client manifest:

```js
// client manifest
{
  entryCSSFiles: {
    'app/entry_name': {
      modules: ['app/foo.css', ...]
    }
  }
}
```

And then, in the font manifest we track all emitted assets (fonts) by
each CSS module:

```js
// font manifest
{
  app: {
    'app/foo.css': [
      'static/font/abc.woff', ...
    ]
  }
}
```

These two fields are only used together by `get-preloadable-fonts.tsx`,
so it can know which font files need to be preloaded for this entry.

(Although previously we use `.modules` for something else, but it's gone
now)

## Changes

Since we only need the font assets per entry, it's unnecessary to track
these in the module level and then join them together. This PR removes
the `modules` field from the client manifest, and changes the font
manifest to directly keep the entry—font mapping.

This gets rid of one module traversal from the client manifest plugin.
2023-06-26 13:43:37 -07:00
..
crates Refactor next-font-manifest-plugin (#51835) 2023-06-26 13:43:37 -07:00
native Extract next-swc Rust code into its own package (#31635) 2021-11-21 12:59:56 +01:00
.vercel.approvers Update codeowners to use Vercel Spaces (#50841) 2023-06-08 12:02:18 +02:00
package.json v13.4.8-canary.5 2023-06-26 16:18:48 +00:00
README.md docs: add readme with development instructions for next/swc (#43834) 2022-12-08 13:38:44 +01:00

@next/swc

This package is responsible for swc compilation customized for next.js

Development

Run tests

cargo test

# Update snapshots and fixtures for tests
UPDATE=1 cargo test

Format code before submitting code

cargo fmt

Build the binary to integrate with next.js

pnpm build-native