зеркало из https://github.com/mozilla/fxa.git
fix(next): resolve package import version warnings
Because: - Importing package.json in sentry config files resulted in build warning 'Should not import the named export' This commit: - Add package version as env var added to js bundle by nextjs Closes #
This commit is contained in:
Родитель
5cbed82649
Коммит
66023d562f
|
@ -7,6 +7,7 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const { composePlugins, withNx } = require('@nx/next');
|
||||
const { withSentryConfig } = require('@sentry/nextjs');
|
||||
const { version } = require('./package.json');
|
||||
|
||||
/**
|
||||
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
|
||||
|
@ -17,6 +18,9 @@ const nextConfig = {
|
|||
// See: https://github.com/gregberge/svgr
|
||||
svgr: false,
|
||||
},
|
||||
env: {
|
||||
version,
|
||||
},
|
||||
experimental: {
|
||||
instrumentationHook: true,
|
||||
serverComponentsExternalPackages: [
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
// The config you add here will be used whenever a users loads a page in their browser.
|
||||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
||||
import { initSentryForNextjsClient } from '@fxa/shared/sentry/client';
|
||||
import { version } from './package.json';
|
||||
|
||||
const DEFAULT_SAMPLE_RATE = '1';
|
||||
const DEFAULT_TRACES_SAMPLE_RATE = '1';
|
||||
|
@ -25,6 +24,6 @@ const sentryConfig = {
|
|||
};
|
||||
|
||||
initSentryForNextjsClient({
|
||||
release: version,
|
||||
release: process.env.version,
|
||||
sentry: sentryConfig,
|
||||
});
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
||||
import { initSentryForNextjsServer } from '@fxa/shared/sentry';
|
||||
import { config } from './config';
|
||||
import { version } from './package.json';
|
||||
|
||||
const sentryConfig = {
|
||||
dsn: config.nextPublicSentryDsn,
|
||||
|
@ -19,7 +18,7 @@ const sentryConfig = {
|
|||
|
||||
initSentryForNextjsServer(
|
||||
{
|
||||
release: version,
|
||||
release: process.env.version,
|
||||
sentry: sentryConfig,
|
||||
},
|
||||
console
|
||||
|
|
Загрузка…
Ссылка в новой задаче