Don't destructure process.env.
parent
4be4ff6479
commit
736347d37c
|
@ -1,16 +1,16 @@
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
const pkg = require('./package.json');
|
const pkg = require('./package.json');
|
||||||
|
|
||||||
const { BASE_PATH, FORCE_SSL, DISABLE_LOGIN, TRACKER_SCRIPT_NAME } = process.env;
|
const scriptName = process.env.TRACKER_SCRIPT_NAME;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
env: {
|
||||||
VERSION: pkg.version,
|
VERSION: pkg.version,
|
||||||
FORCE_SSL: Boolean(FORCE_SSL),
|
FORCE_SSL: Boolean(process.env.FORCE_SSL),
|
||||||
DISABLE_LOGIN: Boolean(DISABLE_LOGIN),
|
DISABLE_LOGIN: Boolean(process.env.DISABLE_LOGIN),
|
||||||
TRACKER_SCRIPT_NAME,
|
TRACKER_SCRIPT_NAME: scriptName,
|
||||||
},
|
},
|
||||||
basePath: BASE_PATH,
|
basePath: process.env.BASE_PATH,
|
||||||
eslint: {
|
eslint: {
|
||||||
ignoreDuringBuilds: true,
|
ignoreDuringBuilds: true,
|
||||||
},
|
},
|
||||||
|
@ -24,14 +24,12 @@ module.exports = {
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return TRACKER_SCRIPT_NAME
|
return scriptName ? [{ source: `/${scriptName}.js`, destination: '/umami.js' }] : [];
|
||||||
? [{ source: `/${TRACKER_SCRIPT_NAME}.js`, destination: '/umami.js' }]
|
|
||||||
: [];
|
|
||||||
},
|
},
|
||||||
async headers() {
|
async headers() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: `/${TRACKER_SCRIPT_NAME || 'umami'}.js`,
|
source: `/${scriptName || 'umami'}.js`,
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
key: 'Cache-Control',
|
key: 'Cache-Control',
|
||||||
|
|
Loading…
Reference in New Issue