@djangocfg/nextjs 2.1.34 → 2.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,23 +17,32 @@ const consola = require('consola');
17
17
 
18
18
  // Parse arguments
19
19
  const args = process.argv.slice(2);
20
- const portArg = args.find(arg => arg.startsWith('--port') || arg === '-p');
21
- const portIndex = args.indexOf(portArg);
22
- const PORT = portArg
23
- ? args[portIndex + 1]
24
- : process.env.PORT || '3000';
20
+
21
+ // Extract port
22
+ let PORT = process.env.PORT || '3000';
23
+ const portIndex = args.findIndex(arg => arg === '-p' || arg === '--port');
24
+ if (portIndex !== -1 && args[portIndex + 1]) {
25
+ PORT = args[portIndex + 1];
26
+ }
25
27
 
26
28
  // Build next dev command
27
- const nextArgs = ['dev'];
29
+ const nextArgs = ['dev', '-p', PORT];
28
30
 
29
- // Add port
30
- if (!args.includes('-p') && !args.includes('--port')) {
31
- nextArgs.push('-p', PORT);
31
+ // Check if --webpack flag is present
32
+ const hasWebpackFlag = args.includes('--webpack');
33
+
34
+ // Add --turbopack by default (unless --webpack is specified)
35
+ // This silences the "webpack config with no turbopack config" warning
36
+ if (!hasWebpackFlag) {
37
+ nextArgs.push('--turbopack');
32
38
  }
33
39
 
34
- // Pass through other flags (like --webpack)
40
+ // Pass through other flags, excluding port arguments
35
41
  args.forEach((arg, i) => {
36
- if (arg !== '-p' && arg !== '--port' && args[i - 1] !== '-p' && args[i - 1] !== '--port') {
42
+ const isPreviousPort = i > 0 && (args[i - 1] === '-p' || args[i - 1] === '--port');
43
+ const isPortFlag = arg === '-p' || arg === '--port';
44
+
45
+ if (!isPortFlag && !isPreviousPort) {
37
46
  nextArgs.push(arg);
38
47
  }
39
48
  });
@@ -14,7 +14,7 @@ var require_package = __commonJS({
14
14
  "package.json"(exports, module) {
15
15
  module.exports = {
16
16
  name: "@djangocfg/nextjs",
17
- version: "2.1.34",
17
+ version: "2.1.35",
18
18
  description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
19
19
  keywords: [
20
20
  "nextjs",