@@ -14,6 +14,7 @@ import {sentryWebpackPlugin} from '@sentry/webpack-plugin/webpack5';
14
14
import CompressionPlugin from 'compression-webpack-plugin' ;
15
15
import HtmlWebpackPlugin from 'html-webpack-plugin' ;
16
16
import fs from 'node:fs' ;
17
+ import { createRequire } from 'node:module' ;
17
18
import path from 'node:path' ;
18
19
import { TsCheckerRspackPlugin } from 'ts-checker-rspack-plugin' ;
19
20
@@ -82,6 +83,8 @@ const DEPLOY_PREVIEW_CONFIG = IS_DEPLOY_PREVIEW && {
82
83
githubRepo : env . NOW_GITHUB_COMMIT_REPO ,
83
84
} ;
84
85
86
+ const require = createRequire ( import . meta. url ) ;
87
+
85
88
// When deploy previews are enabled always enable experimental SPA mode --
86
89
// deploy previews are served standalone. Otherwise fallback to the environment
87
90
// configuration.
@@ -469,7 +472,7 @@ const appConfig: Configuration = {
469
472
// `yarn why` says this is only needed in dev deps
470
473
string_decoder : false ,
471
474
// For framer motion v6, might be able to remove on v11
472
- 'process/browser' : import . meta . resolve ( 'process/browser' ) ,
475
+ 'process/browser' : require . resolve ( 'process/browser' ) ,
473
476
} ,
474
477
475
478
// Prefers local modules over node_modules
@@ -805,7 +808,7 @@ if (IS_PRODUCTION) {
805
808
}
806
809
807
810
if ( CODECOV_TOKEN && ENABLE_CODECOV_BA ) {
808
- const { codecovWebpackPlugin} = await import ( '@codecov/webpack-plugin' ) ;
811
+ const { codecovWebpackPlugin} = require ( '@codecov/webpack-plugin' ) ;
809
812
// defaulting to an empty string which in turn will fallback to env var or
810
813
// determine merge commit sha from git
811
814
const GH_COMMIT_SHA = env . GH_COMMIT_SHA ?? '' ;
0 commit comments