umami/next.config.js
2020-10-05 14:45:24 +07:00

36 lines
609 B
JavaScript

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