@onlook/nextjs

1.1.2 • Public • Published

Onlook nextjs preprocessor

Usage

  1. Install preprocessor library
npm i --save-dev @onlook/nextjs
  1. Update next.config.mjs or next.config.js
// Import path
import path from "path";

const nextConfig = {
  // Add preprocessor
  experimental: {
    swcPlugins: [["@onlook/nextjs", { root: path.resolve(".") }]],
  },
};

export default nextConfig;

For more, see: https://nextjs.org/docs/pages/api-reference/next-config-js

Next version compatibilities

Version 13

Unfortunately, Next.js v13.2.4 ~ v13.3.1 cannot execute SWC Wasm plugins, due to a bug of next-swc. See more here.

Please upgrade to next 13.4.3 or above.

npm i next@13.4.3

Backwards compatibility note

The Next plugins ecosystem is still experimental, so SWC ships backwards incompatible version.

We will keep updating the package to the latest version in hope of a stable release in the future.

https://swc.rs/docs/plugin/selecting-swc-core

Resources

Note

By default, Next does not process node_modules, hence, data-onlook-id won't be generated for these.

Readme

Keywords

Package Sidebar

Install

npm i @onlook/nextjs

Homepage

onlook.dev

Weekly Downloads

9

Version

1.1.2

License

ISC

Unpacked Size

4.21 MB

Total Files

5

Last publish

Collaborators

  • kitenite