@wyw-in-js/nextjs 1.1.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/esm/index.mjs +269 -349
- package/esm/index.mjs.map +1 -1
- package/package.json +13 -13
- package/types/index.d.ts +2 -1
- package/types/index.js +38 -95
- package/lib/index.js +0 -394
- package/lib/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -23,10 +23,10 @@ bun add -d @wyw-in-js/nextjs
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
// next.config.
|
|
27
|
-
|
|
26
|
+
// next.config.mjs
|
|
27
|
+
import { withWyw } from '@wyw-in-js/nextjs';
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
export default withWyw({
|
|
30
30
|
// your Next config
|
|
31
31
|
});
|
|
32
32
|
```
|
|
@@ -36,7 +36,18 @@ By default, the plugin:
|
|
|
36
36
|
- injects `@wyw-in-js/webpack-loader` into Next's JS/TS pipeline;
|
|
37
37
|
- emits styles as `*.wyw-in-js.module.css` so imports are allowed from any module;
|
|
38
38
|
- keeps generated class names stable under Next CSS Modules (selectors are emitted as `:global(...)`).
|
|
39
|
-
-
|
|
39
|
+
- parses and evaluates JS/TS/JSX/TSX through the Oxc-backed WyW transform.
|
|
40
|
+
|
|
41
|
+
## Eval resolver modes
|
|
42
|
+
|
|
43
|
+
`eval.resolver: 'native'` and the native step of `eval.resolver: 'hybrid'` use `oxc-resolver` with automatic
|
|
44
|
+
`tsconfig.json` discovery.
|
|
45
|
+
|
|
46
|
+
The webpack path inherits `@wyw-in-js/webpack-loader` static `resolve.alias` forwarding. The Turbopack path forwards
|
|
47
|
+
string aliases from `turbopack.resolveAlias` or `experimental.turbo.resolveAlias` when configured through `withWyw()`.
|
|
48
|
+
|
|
49
|
+
Use `hybrid` when evaluated imports may rely on Next, webpack, or Turbopack resolver behavior. Use `native` only when
|
|
50
|
+
`oxc-resolver` can resolve all evaluated imports, or mirror bundler-only aliases in `oxcOptions.resolver.alias`.
|
|
40
51
|
|
|
41
52
|
## Options
|
|
42
53
|
|
|
@@ -47,6 +58,6 @@ import type { WywNextPluginOptions } from '@wyw-in-js/nextjs';
|
|
|
47
58
|
Use `loaderOptions` to pass options through to `@wyw-in-js/webpack-loader`.
|
|
48
59
|
|
|
49
60
|
Use `turbopackLoaderOptions` to pass JSON-serializable options to `@wyw-in-js/turbopack-loader` (use `configFile` for
|
|
50
|
-
function-based config).
|
|
61
|
+
function/RegExp-based config).
|
|
51
62
|
|
|
52
63
|
To disable vendor prefixing (Stylis prefixer), set `prefixer: false` in `loaderOptions` and/or `turbopackLoaderOptions`.
|