umami/next.config.js
2022-02-16 20:58:44 -08:00

38 lines
754 B
JavaScript

require('dotenv').config();
const pkg = require('./package.json');
module.exports = {
env: {
VERSION: pkg.version,
FORCE_SSL: !!process.env.FORCE_SSL,
DISABLE_LOGIN: !!process.env.DISABLE_LOGIN,
TRACKER_SCRIPT_NAME: process.env.TRACKER_SCRIPT_NAME,
},
basePath: process.env.BASE_PATH,
eslint: {
ignoreDuringBuilds: true,
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
issuer: /\.js$/,
use: ['@svgr/webpack'],
});
return config;
},
async headers() {
return [
{
source: '/umami.js',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=2592000', // 30 days
},
],
},
];
},
};