💡next-compose-plugins provides a cleaner API for enabling and configuring plugins for next.js
MIT License
736
stars
12
forks
source link
how to use next-awesome-typescript with next-compose-plugins? when i use next-awesome-typescript to replace @zeit/next-typescript, can someone help me? #6
Hi @Deval520
next-awesome-typescript unfortunately doesn't comply with the standardized plugin API every other plugin I know is using.
But you can create a wrapper function to make it compatible:
// next.config.js
const withPlugins = require('next-compose-plugins');
const awesomeTypescript = require('next-awesome-typescript');
const nextConfig = { /* config for next.js if you have any */ };
module.exports = withPlugins([
(config) => awesomeTypescript({}, config),
// add your other plugins here
// e.g.: [sass, { /* sass config */ }],
], nextConfig);
If you need to set some options on the next-awesome-typescript plugin, you can do it in the first parameter on the awesomeTypescript call inside the wrapper function:
I'm currently working on version 2 of next-compose-plugin which has many improvements and I'm looking forward to release it this weekend. I'll also check if I find a easier and out-of-the-box solution for such plugins which have a different API and include it in this version.
Hi @Deval520
next-awesome-typescript
unfortunately doesn't comply with the standardized plugin API every other plugin I know is using. But you can create a wrapper function to make it compatible:If you need to set some options on the next-awesome-typescript plugin, you can do it in the first parameter on the awesomeTypescript call inside the wrapper function:
Does this work for you?
I'm currently working on version 2 of
next-compose-plugin
which has many improvements and I'm looking forward to release it this weekend. I'll also check if I find a easier and out-of-the-box solution for such plugins which have a different API and include it in this version.