@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 CHANGED
@@ -23,10 +23,10 @@ bun add -d @wyw-in-js/nextjs
23
23
  ## Usage
24
24
 
25
25
  ```js
26
- // next.config.js
27
- const { withWyw } = require('@wyw-in-js/nextjs');
26
+ // next.config.mjs
27
+ import { withWyw } from '@wyw-in-js/nextjs';
28
28
 
29
- module.exports = withWyw({
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
- - defaults `babelOptions` to `presets: ['next/babel']` so TS/JSX parsing works out of the box.
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`.