Sina Abedi
Sina Abedi

Reputation: 2381

Multi Exports in next.config.json

I want to add withPWA and withTypescript together, but i don't know how to config them...

this is my next.config.json code :

const withPWA = require("next-pwa");

module.exports = withPWA({
  pwa: {
    dest: "public",
  },
});

and

const withTypescript = require('@zeit/next-typescript');

module.exports = withTypescript();

these configs only work alone...how can i make them work together?

Upvotes: 1

Views: 119

Answers (1)

Monzoor Tamal
Monzoor Tamal

Reputation: 810

const withPWA = require("next-pwa");

const withTypescript = require('@zeit/next-typescript');

const config = {
    pwa: {
      dest: "public",
    },
}

module.exports = withTypescript(withPWA(config));

Use like this

Upvotes: 2

Related Questions