@@ -88,29 +88,17 @@ module.exports = {
8888 PREVIEW_SERVER_LOCATION: '${ builtPreviewAppPath . replace ( / \\ / g, '/' ) } ',
8989 USER_PROJECT_LOCATION: userProjectLocation
9090 },
91- // this is needed so that the code for building emails works properly
92- webpack: (
93- /** @type {import('webpack').Configuration & { externals: string[] }} */
94- config,
95- { isServer }
96- ) => {
97- if (isServer) {
98- config.externals.push('esbuild');
99- }
100-
101- return config;
102- },
91+ serverExternalPackages: ['esbuild'],
10392 typescript: {
10493 ignoreBuildErrors: true
10594 },
106- eslint: {
107- ignoreDuringBuilds: true
108- },
10995 experimental: {
11096 webpackBuildWorker: true
11197 },
11298}` ;
11399
100+ await fs . promises . rm ( path . resolve ( builtPreviewAppPath , './next.config.ts' ) ) ;
101+
114102 await fs . promises . writeFile (
115103 path . resolve ( builtPreviewAppPath , './next.config.js' ) ,
116104 nextConfigContents ,
@@ -202,7 +190,8 @@ const updatePackageJson = async (builtPreviewAppPath: string) => {
202190 dependencies : Record < string , string > ;
203191 devDependencies : Record < string , string > ;
204192 } ;
205- packageJson . scripts . build = 'next build' ;
193+ // Turbopack has some errors with the imports in @react -email/tailwind
194+ packageJson . scripts . build = 'next build --webpack' ;
206195 packageJson . scripts . start = 'next start' ;
207196 delete packageJson . scripts . postbuild ;
208197
@@ -214,12 +203,6 @@ const updatePackageJson = async (builtPreviewAppPath: string) => {
214203 packageJson . dependencies [ dependency ] = version . replace ( 'workspace:' , '' ) ;
215204 }
216205
217- // We remove this one to avoid having resolve issues on our demo build process.
218- // This is only used in the `export` command so it's irrelevant to have it here.
219- //
220- // See `src/actions/render-email-by-path` for more info on how we render the
221- // email templates without `@react-email/render` being installed.
222- delete packageJson . devDependencies [ '@react-email/render' ] ;
223206 delete packageJson . devDependencies [ '@react-email/components' ] ;
224207 delete packageJson . scripts . prepare ;
225208
0 commit comments