Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cacheDir option doesn't change cache directory #17491

Closed
7 tasks done
rtritto opened this issue Jun 16, 2024 · 5 comments
Closed
7 tasks done

cacheDir option doesn't change cache directory #17491

rtritto opened this issue Jun 16, 2024 · 5 comments

Comments

@rtritto
Copy link

rtritto commented Jun 16, 2024

Describe the bug

I want change the directory of cache with cacheDir option and the folder generated is always node_modules/.vite instead of .vite/cache.

I'm using yarn berry v4 with Plug'n'Play (PnP).

Reproduction

template-electron-vite

Steps to reproduce

  • git clone https://github.com/rtritto/template-electron-vite.git
  • cd template-electron-vite
  • yarn
  • yarn start

Current vite.config.ts

import { defineConfig } from 'vite'

export default defineConfig(({ root, mode, command }) => {
  return {
    root,
    mode,
    build: {
      emptyOutDir: false,
      outDir: '.vite/build',
      watch: command === 'serve' ? {} : null,
      minify: command === 'build',
      sourcemap: command === 'serve'
    },
    cacheDir: '.vite/cache',  // OR path.join(process.cwd(), '.vite/cache'),
    clearScreen: false
  }
}

System Info

  System:
    OS: Windows 11
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.3.0 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium 126
    Internet Explorer: 11

Used Package Manager

yarn

Logs

No response

Validations

Copy link

Hello @rtritto. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@rtritto
Copy link
Author

rtritto commented Jun 18, 2024

@github-actions done

@rtritto
Copy link
Author

rtritto commented Jun 18, 2024

FYI @bluwy

@hi-ogawa
Copy link
Collaborator

Do you have a reproduction without @electron-forge/plugin-vite?
If not, then the issue is likely there, so it's probably better to report it to https://github.com/electron/forge

@rtritto
Copy link
Author

rtritto commented Jun 19, 2024

No problem with the branch https://github.com/rtritto/electron-vite-react/tree/test-cacheDir.
Reproduction:

  • git clone https://github.com/rtritto/electron-vite-react.git
  • cd electron-vite-react
  • yarn vite
  • the .vite/cache directory has been created

I created the issue electron/forge#3630 on electron-forge, so I will close this issue for now.

@rtritto rtritto closed this as completed Jun 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants