Skip to content

Commit

Permalink
fix(app): fix env files not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
abedzantout committed Apr 7, 2021
1 parent 2eea148 commit 4e9ce71
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');
const Dotenv = require('dotenv-webpack');

const next_config = {
webpack: (config) => {
config.plugins = config.plugins || [];

config.plugins = [
...config.plugins,
// Read the .env file
new Dotenv({
path: path.join(__dirname, '.env'),
systemvars: true
})
];

return config;
}
};

module.exports = { ...next_config };
4 changes: 3 additions & 1 deletion shared/components/footer/footer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { FunctionComponent } from 'react';

import styles from './footer.module.scss';

const pjson = require('../../../package.json');

const Footer: FunctionComponent = () => {
const year = new Date().getFullYear();
return (
Expand All @@ -15,7 +17,7 @@ const Footer: FunctionComponent = () => {
>
TechHive.IO
</a>
{' ' + year}
{' ' + year} - Version {pjson.version}
</span>
</footer>
);
Expand Down

0 comments on commit 4e9ce71

Please sign in to comment.