@@ -161,10 +161,8 @@ const nextDev: cliCommand = async (argv) => {
161
161
port,
162
162
}
163
163
164
- // check for postcss, babelrc, swc plugins
164
+ // check for babelrc, swc plugins
165
165
async function validateNextConfig ( isCustomTurbopack : boolean ) {
166
- const { findConfigPath } =
167
- require ( '../lib/find-config' ) as typeof import ( '../lib/find-config' )
168
166
const { getPkgManager } =
169
167
require ( '../lib/helpers/get-pkg-manager' ) as typeof import ( '../lib/helpers/get-pkg-manager' )
170
168
const { getBabelConfigFile } =
@@ -175,8 +173,6 @@ const nextDev: cliCommand = async (argv) => {
175
173
require ( 'next/dist/compiled/chalk' ) as typeof import ( 'next/dist/compiled/chalk' )
176
174
const { interopDefault } =
177
175
require ( '../lib/interop-default' ) as typeof import ( '../lib/interop-default' )
178
- const findUp =
179
- require ( 'next/dist/compiled/find-up' ) as typeof import ( 'next/dist/compiled/find-up' )
180
176
181
177
// To regenerate the TURBOPACK gradient require('gradient-string')('blue', 'red')('>>> TURBOPACK')
182
178
const isTTY = process . stdout . isTTY
@@ -190,13 +186,10 @@ const nextDev: cliCommand = async (argv) => {
190
186
let thankYouMsg = `Thank you for trying Next.js v13 with Turbopack! As a reminder,\nTurbopack is currently in alpha and not yet ready for production.\nWe appreciate your ongoing support as we work to make it ready\nfor everyone.\n`
191
187
192
188
let unsupportedParts = ''
193
- // TODO: warning for postcss mentioning sidecar
194
189
let babelrc = await getBabelConfigFile ( dir )
195
190
if ( babelrc ) babelrc = path . basename ( babelrc )
196
191
197
192
let hasNonDefaultConfig
198
- let postcssFile
199
- let tailwindFile
200
193
let rawNextConfig : NextConfig = { }
201
194
202
195
try {
@@ -220,7 +213,7 @@ const nextDev: cliCommand = async (argv) => {
220
213
if (
221
214
configKey === 'serverComponentsExternalPackages' ||
222
215
configKey === 'appDir' ||
223
- configKey === 'transpilePackages ' ||
216
+ configKey === 'images ' ||
224
217
configKey === 'reactStrictMode' ||
225
218
configKey === 'swcMinify' ||
226
219
configKey === 'configFileName'
@@ -248,29 +241,11 @@ const nextDev: cliCommand = async (argv) => {
248
241
hasNonDefaultConfig = Object . keys ( rawNextConfig ) . some ( ( key ) =>
249
242
checkUnsupportedCustomConfig ( key , rawNextConfig , defaultConfig )
250
243
)
251
-
252
- const packagePath = findUp . sync ( 'package.json' , { cwd : dir } )
253
- let hasSideCar = false
254
-
255
- if ( packagePath ) {
256
- const pkgData = require ( packagePath )
257
- hasSideCar = Object . values (
258
- ( pkgData . scripts || { } ) as Record < string , string >
259
- ) . some (
260
- ( script ) => script . includes ( 'tailwind' ) || script . includes ( 'postcss' )
261
- )
262
- }
263
- postcssFile = ! hasSideCar && ( await findConfigPath ( dir , 'postcss' ) )
264
- tailwindFile = ! hasSideCar && ( await findConfigPath ( dir , 'tailwind' ) )
265
-
266
- if ( postcssFile ) postcssFile = path . basename ( postcssFile )
267
- if ( tailwindFile ) tailwindFile = path . basename ( tailwindFile )
268
244
} catch ( e ) {
269
245
console . error ( 'Unexpected error occurred while checking config' , e )
270
246
}
271
247
272
- const hasWarningOrError =
273
- tailwindFile || postcssFile || babelrc || hasNonDefaultConfig
248
+ const hasWarningOrError = babelrc || hasNonDefaultConfig
274
249
if ( ! hasWarningOrError ) {
275
250
thankYouMsg = chalk . dim ( thankYouMsg )
276
251
}
@@ -297,40 +272,19 @@ const nextDev: cliCommand = async (argv) => {
297
272
unsupportedParts += `\n\n- Unsupported Next.js configuration option(s) (${ chalk . cyan (
298
273
'next.config.js'
299
274
) } )\n ${ chalk . dim (
300
- `The only configurations options supported are:\n - ${ chalk . cyan (
301
- 'experimental.serverComponentsExternalPackages'
302
- ) } \n - ${ chalk . cyan (
303
- 'transpilePackages'
304
- ) } \n To use Turbopack, remove other configuration options.`
275
+ `The only configurations options supported are:\n${ [
276
+ 'reactStrictMode' ,
277
+ 'experimental.appDir' ,
278
+ 'experimental.serverComponentsExternalPackages' ,
279
+ 'images' ,
280
+ 'swcMinify' ,
281
+ 'configFileName' ,
282
+ ]
283
+ . map ( ( name ) => ` - ${ chalk . cyan ( name ) } \n` )
284
+ . join ( '' ) } To use Turbopack, remove other configuration options.`
305
285
) } `
306
286
}
307
287
308
- if ( postcssFile || tailwindFile ) {
309
- console . warn (
310
- `${ chalk . bold . yellow (
311
- 'Warning:'
312
- ) } You are using configuration that may require additional\nsetup with Turbopack. If you already made these changes please\nignore this warning.\n`
313
- )
314
- }
315
-
316
- if ( postcssFile ) {
317
- console . warn (
318
- `- PostCSS detected (${ chalk . cyan ( postcssFile ) } )\n` +
319
- ` ${ chalk . dim (
320
- 'PostCSS is not yet supported by Next.js v13 with Turbopack.\n To use with Turbopack, see: https://nextjs.link/turbopack-postcss'
321
- ) } \n`
322
- )
323
- }
324
-
325
- if ( tailwindFile ) {
326
- console . warn (
327
- `- Tailwind detected (${ chalk . cyan ( tailwindFile ) } )\n` +
328
- ` ${ chalk . dim (
329
- 'Tailwind is not yet supported by Next.js v13 with Turbopack.\n To use with Turbopack, see: https://nextjs.link/turbopack-tailwind'
330
- ) } \n`
331
- )
332
- }
333
-
334
288
if ( unsupportedParts ) {
335
289
const pkgManager = getPkgManager ( dir )
336
290
@@ -425,8 +379,6 @@ If you cannot make the changes above, but still want to try out\nNext.js v13 wit
425
379
: packagePath
426
380
? path . dirname ( packagePath )
427
381
: undefined ) ,
428
- serverComponentsExternalPackages :
429
- rawNextConfig . experimental ?. serverComponentsExternalPackages ,
430
382
} )
431
383
// Start preflight after server is listening and ignore errors:
432
384
preflight ( ) . catch ( ( ) => { } )
0 commit comments