Copilot commented on code in PR #86:
URL: https://github.com/apache/grails-forge-ui/pull/86#discussion_r2868557633


##########
app/launch/vite.config.js:
##########
@@ -0,0 +1,34 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import svgr from 'vite-plugin-svgr'
+import path from 'path'
+
+export default defineConfig({
+  plugins: [svgr(), react()],
+  base: './',
+  server: {
+    port: 3000,
+    open: true,
+  },
+  build: {
+    outDir: 'build',
+  },
+  resolve: {
+    alias: {
+      // @materializecss/materialize exports only JS in its package.json 
"exports" field,
+      // so we alias direct CSS imports to the actual file paths.
+      '@materializecss/materialize/dist/css': path.resolve(
+        __dirname,
+        'node_modules/@materializecss/materialize/dist/css'
+      ),

Review Comment:
   `vite.config.js` is using `__dirname` inside an ESM-style Vite config (uses 
`import`/`export default`). In Node ESM, `__dirname` is undefined, so the 
config will throw at startup. Compute the directory via `import.meta.url` 
(e.g., `fileURLToPath`) or resolve from `process.cwd()` instead of `__dirname`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to