umami/next.config.js
Mike Cao e2b2238fb9
Merge pull request #271 from fransallen/master
Implement Cache-Control header for umami.js
2020-10-07 08:29:31 -07:00

34 lines
590 B
JavaScript

require('dotenv').config();
const pkg = require('./package.json');
module.exports = {
env: {
VERSION: pkg.version,
FORCE_SSL: !!process.env.FORCE_SSL,
},
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
},
],
},
]
},
};