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

fix: disable emptyOutDir in non-development modes #199

Conversation

antoinematyja
Copy link
Contributor

Description 📖

This pull request solves the issue discussed in #186
Staging mode was inconsistent with production mode

Background 📜

This was happening because the code was checking for mode === 'production', but we need the same settings in all non-dev environments (not sure about CI but I guess?).

The Fix 🔨

Replaced previous isProduction with !isDevelopment, also added a test but my test game is pretty bad, feel free to rework it

@@ -37,11 +37,11 @@ function config (userConfig: UserConfig, env: ConfigEnv): UserConfig {
const fs = { allow: [projectRoot], strict: true }
const server = { host, https, port, strictPort: true, fs }

const isProduction = config.mode === 'production'
const isDevelopment = config.mode === 'development'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the purpose of removing old assets in the local environment:

Suggested change
const isDevelopment = config.mode === 'development'
const isDevelopment = config.mode === 'development' || config.mode === 'test'

@ElMassimo
Copy link
Owner

ElMassimo commented Apr 1, 2022

Hi Antoine! @antoinematyja

Looks great, thanks for your contribution! 😃

@ElMassimo ElMassimo merged commit 94e75a3 into ElMassimo:main Apr 1, 2022
@ElMassimo
Copy link
Owner

Released in vite-plugin-ruby@3.0.9, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants