Add Stylus support to Next.js.
npm install next-stylus stylus stylus-loader
With next-with-plugins
/* next.config.js */
const withPlugins = require('next-with-plugins')
module.exports = withPlugins({
plugins: [
'next-stylus'
]
})
/* next.config.js */
const withStylus = require('next-stylus')
module.exports = withStylus({
/* Next.js config options here */
})
Add a reference to this module in a declaration file.
/* declarations.d.ts */
/// <reference types="next-stylus" />