Ver código fonte

Move to @/next package

Manav Rathi 1 ano atrás
pai
commit
3e9538f59e

+ 1 - 1
apps/accounts/next.config.js

@@ -1,4 +1,4 @@
-const nextConfigBase = require('@ente/shared/next/next.config.base.js');
+const nextConfigBase = require('@/next/next.config.base.js');
 
 module.exports = {
     ...nextConfigBase,

+ 1 - 1
apps/auth/next.config.js

@@ -1,3 +1,3 @@
-const nextConfigBase = require('@ente/shared/next/next.config.base.js');
+const nextConfigBase = require('@/next/next.config.base.js');
 
 module.exports = nextConfigBase;

+ 1 - 1
apps/cast/next.config.js

@@ -1,3 +1,3 @@
-const nextConfigBase = require('@ente/shared/next/next.config.base.js');
+const nextConfigBase = require('@/next/next.config.base.js');
 
 module.exports = nextConfigBase;

+ 1 - 1
apps/photos/next.config.js

@@ -1,3 +1,3 @@
-const nextConfigBase = require('@ente/shared/next/next.config.base.js');
+const nextConfigBase = require('@/next/next.config.base.js');
 
 module.exports = nextConfigBase;

+ 2 - 0
packages/next/.eslintrc.js

@@ -3,4 +3,6 @@ module.exports = {
     parserOptions: {
         tsconfigRootDir: __dirname,
     },
+    // TODO (MR): Figure out a way to not have to ignored the next config .js
+    ignorePatterns: [".eslintrc.js", "next.config.base.js"],
 };

+ 12 - 12
packages/shared/next/next.config.base.js → packages/next/next.config.base.js

@@ -10,13 +10,13 @@
  * https://nextjs.org/docs/pages/api-reference/next-config-js
  */
 
-const { withSentryConfig } = require('@sentry/nextjs');
-const cp = require('child_process');
+const { withSentryConfig } = require("@sentry/nextjs");
+const cp = require("child_process");
 
 const gitSHA = cp
-    .execSync('git rev-parse --short HEAD', {
+    .execSync("git rev-parse --short HEAD", {
         cwd: __dirname,
-        encoding: 'utf8',
+        encoding: "utf8",
     })
     .trimEnd();
 
@@ -24,21 +24,21 @@ const gitSHA = cp
  * The base Next.js config. Before exporting this, we wrap this in
  * {@link withSentryConfig}.
  *
- * @type {import('next').NextConfig}
+ * @type {import("next").NextConfig}
  */
 const nextConfig = {
     /* generate a static export when we run `next build` */
-    output: 'export',
+    output: "export",
     compiler: {
         emotion: true,
     },
     transpilePackages: [
-        '@/next',
-        '@/ui',
-        '@/utils',
-        '@mui/material',
-        '@mui/system',
-        '@mui/icons-material',
+        "@/next",
+        "@/ui",
+        "@/utils",
+        "@mui/material",
+        "@mui/system",
+        "@mui/icons-material",
     ],
 
     // Add environment variables to the JavaScript bundle. They will be