-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
next.config.js
38 lines (34 loc) · 1.04 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
/* eslint-disable @typescript-eslint/no-require-imports */
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 config;
};