P粉3223196012023-08-29 20:01:50
First, you need to exclude the folders in next.config.js
, assuming all the data you need to exclude is in the data
folder:
const nextConfig = { // ... exclude: ['data'], };
Secondly, you need to import the data
folder using require
in order to use json data:
const users = require('./data/users.json');