next-composer
v1.0.4
Published
Compose NextJS plugins for NextServer config.
Downloads
9
Maintainers
Readme
next-composer
Compose NextJS plugins for NextServer config.
Installation
yarn add next-composer
Usage
// Node module
import next from 'next';
import composer from 'next-composer';
// Next plugin
import fonts from 'next-fonts';
import css from '@zeit/next-css';
import typescript from '@zeit/next-typescript';
import optimizedImages from 'next-optimized-images';
// Definition
import { ServerOptions } from 'next-server';
// Compose plugins
const nextConfig: ServerOptions = {
dev: true,
quiet: true,
conf: composer([css, fonts, optimizedImages, typescript], {
// Your next config
}),
};
// Compose plugins with their own settings
const nextConfigWithPluginsSettings: ServerOptions = {
dev: true,
quiet: true,
conf: composer(
[
[css, { cssModules: true }],
fonts,
optimizedImages,
typescript,
],
{
// Your next config
},
),
};
// NextServer instance
const nextServer = next(nextConfig);
const nextServerWithPluginsSettings = next(nextConfigWithPluginsSettings);
Author
miZyind [email protected]
LICENSE
Licensed under the MIT License.
Thanks to
- @cyrilwanner for next-compose-plugins