feat: add appVersion in browser
This commit is contained in:
parent
76ffdc4094
commit
3345a533d2
|
@ -1,6 +1,7 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
const withNextIntl = require('next-intl/plugin')();
|
const withNextIntl = require('next-intl/plugin')();
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const json = require('./package.json');
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
|
@ -14,6 +15,9 @@ const nextConfig = {
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
includePaths: [path.join(__dirname, 'styles')],
|
includePaths: [path.join(__dirname, 'styles')],
|
||||||
},
|
},
|
||||||
|
env: {
|
||||||
|
version: json.version
|
||||||
|
},
|
||||||
typescript: {
|
typescript: {
|
||||||
// !! WARN !!
|
// !! WARN !!
|
||||||
// Dangerously allow production builds to successfully complete even if
|
// Dangerously allow production builds to successfully complete even if
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode, Suspense } from 'react';
|
||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
@ -6,7 +6,7 @@ import { ConfigProvider } from 'antd';
|
||||||
import { AntdRegistry } from '@ant-design/nextjs-registry';
|
import { AntdRegistry } from '@ant-design/nextjs-registry';
|
||||||
import theme from '../../constants/theme';
|
import theme from '../../constants/theme';
|
||||||
import { ALLOWED_LOCALES } from '../../constants/locale';
|
import { ALLOWED_LOCALES } from '../../constants/locale';
|
||||||
import { Header, Footer } from '../../components/Page';
|
import { Header, Footer, AppConfig } from '../../components/Page';
|
||||||
|
|
||||||
type LayoutProps = {
|
type LayoutProps = {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
@ -30,6 +30,9 @@ export default function LocaleLayout({ children, params: { locale } }: LayoutPro
|
||||||
<AntdRegistry>
|
<AntdRegistry>
|
||||||
<ConfigProvider theme={theme}>
|
<ConfigProvider theme={theme}>
|
||||||
<div className="b-wrapper">
|
<div className="b-wrapper">
|
||||||
|
<Suspense fallback={null}>
|
||||||
|
<AppConfig />
|
||||||
|
</Suspense>
|
||||||
<div className="b-content">
|
<div className="b-content">
|
||||||
<Header locale={locale} />
|
<Header locale={locale} />
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
export const AppConfig = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('AppVersion', process.env.version);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
|
@ -1,3 +1,4 @@
|
||||||
export * from './Header';
|
export * from './Header';
|
||||||
export * from './Footer';
|
export * from './Footer';
|
||||||
export * from './GeneralTopSection';
|
export * from './GeneralTopSection';
|
||||||
|
export * from './AppConfig';
|
||||||
|
|
Loading…
Reference in New Issue