Skip to content

Commit

Permalink
fix: initialization of ntm
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed May 17, 2022
1 parent 342b391 commit f0ea800
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions apps/nextjs-app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,10 @@ const nextConfig = {
},
};

let config;

if (tmModules.length > 0) {
const withNextTranspileModules = require('next-transpile-modules')(
tmModules,
{
resolveSymlinks: true,
debug: false,
}
);
config = withNextTranspileModules(nextConfig);
} else {
config = nextConfig;
}
let config = nextConfig;

if (!NEXTJS_DISABLE_SENTRY) {
// @ts-ignore because sentry does not match nextjs current definitions
config = withSentryConfig(config, {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
Expand All @@ -274,6 +262,21 @@ if (!NEXTJS_DISABLE_SENTRY) {
});
}

if (tmModules.length > 0) {
console.info(
`${pc.green('notice')}- Will transpile [${tmModules.join(',')}]`
);

const withNextTranspileModules = require('next-transpile-modules')(
tmModules,
{
resolveSymlinks: true,
debug: false,
}
);
config = withNextTranspileModules(config);
}

if (process.env.ANALYZE === 'true') {
// @ts-ignore
const withBundleAnalyzer = require('@next/bundle-analyzer')({
Expand Down

0 comments on commit f0ea800

Please sign in to comment.