Next.js + Prebuild Webpack Plugin
Use Prebuild Webpack Plugin with Next.js
Installation
npm install --save @hashicorp/next-prebuild
or
yarn add @hashicorp/next-prebuild
Usage
Create a next.config.js
in your project
// next.config.js
const withPrebuild = require("@hashicorp/next-prebuild");
module.exports = withPrebuild({
/* options */
})();
All prebuild options are documented here
Optionally you can add your custom Next.js configuration as parameter
// next.config.js
const withPrebuild = require("@hashicorp/next-prebuild");
module.exports = withPrebuild()({
webpack(config, options) {
return config;
}
});