Install the next – compose – plugins
npm install --save next-compose-plugins
Method of use
- Create a new next-config.js file in the project root directory
2. Configure the next.config.js file
// next.config.js const withPlugins = require('next-compose-plugins'); // introduce plugin manager const sass = require('@zeit/next-css'); Const withVideos = require('next-videos'); If (typeof require! == 'undefined') { require.extensions['.css'] = file => { } } module.exports = withPlugins([ [sass], WithVideos // Export plugins into plugin manager]);Copy the code
3. After saving the configuration file, you can use the plug-in