- Start the dev mode of the monorepo
pnpm devThis will start the dev mode of both the hooks and components packages, along with the example app.
-
Visit the example app at http://localhost:3000
-
Make changes to the packages and see them reflected in the example app
- Start the dev mode for both packages in the scaffold-ui directory:
# For hooks
cd packages/hooks && pnpm run dev &
# For components
cd packages/components && pnpm run dev &- Add both packages in Scaffold-ETH 2 inside the
packages/nextjs/package.jsonfile:
"@scaffold-ui/hooks": "file:../../../scaffold-ui/packages/hooks",
"@scaffold-ui/components": "file:../../../scaffold-ui/packages/components"Note: The relative paths use ../../../ because they are resolved from the packages/nextjs directory in Scaffold-ETH 2's workspace structure.
- Update the
webpacksection in thenext.config.jsornext.config.tsfile:
webpack: (config, { dev }) => {
config.resolve.fallback = { fs: false, net: false, tls: false };
config.externals.push("pino-pretty", "lokijs", "encoding");
if (dev) {
config.watchOptions = {
followSymlinks: true,
};
config.snapshot.managedPaths = [];
}
return config;
},- Add the css file in
packages/nextjs/app/layout.tsxfile for the components package:
import "@scaffold-ui/components/styles.css";- Install dependencies in Scaffold-ETH 2:
yarn install- Run Scaffold-ETH 2 app:
yarn chain # In one terminal
yarn start # In another terminal- Any changes in this repo will require running
yarn installin Scaffold-ETH 2 again.