Use Typescript 3+ with Next.js 7+
This plugin implements ts-loader with Next.js.
yarn add ts-loader next-with-typescript
Create a next.config.js
in your project
// next.config.js
const withTypescript = require('next-with-typescript')
module.exports = withTypescript()
Optionally you can add your custom Next.js configuration as parameter
// next.config.js
const withTypescript = require('next-with-typescript')
module.exports = withTypescript({
webpack(config, options) {
return config
}
})