forked from icflorescu/mantine-datatable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
39 lines (35 loc) · 1.12 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* eslint-disable @typescript-eslint/no-var-requires */
const withPWA = require('@ducanh2912/next-pwa').default({ dest: 'public' });
const { name: PACKAGE_NAME, version: PACKAGE_VERSION } = require('./package.json');
module.exports = async () => {
const { downloads } = await fetch('https://api.npmjs.org/downloads/point/last-month/mantine-datatable')
.then((res) => res.json())
.catch(() => ({ downloads: 0 }));
/**
* @type {import('next').NextConfig}
*/
const config = {
output: 'export',
trailingSlash: true,
images: { unoptimized: true },
experimental: {
typedRoutes: true,
optimizePackageImports: [
'@mantine/code-highlight',
'@mantine/core',
'@mantine/dates',
'@mantine/hooks',
'@mantine/modals',
'@mantine/notifications',
],
},
env: {
GITHUB_PAGES: String(process.env.GITHUB_PAGES === 'TRUE' || false).toUpperCase(),
PACKAGE_NAME,
PACKAGE_VERSION,
INITIAL_NPM_DOWNLOADS: String(downloads),
},
};
if (process.env.GITHUB_PAGES) config.basePath = '/mantine-datatable';
return withPWA(config);
};