ElMassimo / ElMassimo/vite_ruby

bin/vite build should respect `--mode` option

Open
#584 2 comments 0 reactions 0 assignees View on GitHub
bug: needs reproduction
Dominant language
Ruby
Stars
1.6k
Forks
149
Avg merge
5h 13m
Merged PRs (30d)
2

Description

[troubleshooting section]: https://vite-ruby.netlify.app/guide/troubleshooting.html

- [x] I have tried upgrading by running `bundle update vite_ruby`.
- [x] I have read the __[troubleshooting section]__ before opening an issue.

### Description 📖

`RAILS_ENV` should not override `--mode` option suppllied to vite build. Event supplying `NODE_ENV` still got override by `RAILS_ENV`.

```
RAILS_ENV=staging bin/vite build --mode production
```

### Reproduction 🐞
`bin/vite build --mode=production`

```
Building with Vite ⚡️
vite v5.4.20 building for development...
transforming...
```

Vite Ruby Info

_Run `bin/vite build --mode=production` and provide the output:_

```
Building with Vite ⚡️
vite v5.4.20 building for development...
transforming...
```

### Logs 📜

_If not providing a reproduction:_

Output

_Run `DEBUG=vite-plugin-ruby:* bin/vite dev` or `DEBUG=vite-plugin-ruby:* bin/vite build` and provide the output:_

```
DEBUG=vite-plugin-ruby:* bin/vite dev
vite-plugin-ruby:config {
vite-plugin-ruby:config base: '/vite-dev/',
vite-plugin-ruby:config build: {
vite-plugin-ruby:config emptyOutDir: true,
vite-plugin-ruby:config sourcemap: false,
vite-plugin-ruby:config assetsDir: 'assets',
vite-plugin-ruby:config manifest: true,
vite-plugin-ruby:config outDir: '../../public/vite-dev',
vite-plugin-ruby:config rollupOptions: { input: [Object], output: [Object] }
vite-plugin-ruby:config },
vite-plugin-ruby:config envDir: '/path/to/project',
vite-plugin-ruby:config root: '/path/to/project/app/frontend',
vite-plugin-ruby:config server: {
vite-plugin-ruby:config fs: { allow: [Array], strict: true },
vite-plugin-ruby:config host: 'localhost',
vite-plugin-ruby:config https: false,
vite-plugin-ruby:config port: 3036,
vite-plugin-ruby:config strictPort: true,
vite-plugin-ruby:config hmr: { clientPort: 3036 }
vite-plugin-ruby:config },
vite-plugin-ruby:config entrypoints: {
vite-plugin-ruby:config 'entrypoints/app.css': '/path/to/project/app/frontend/entrypoints/app.css',
vite-plugin-ruby:config 'entrypoints/app.ts': '/path/to/project/app/frontend/entrypoints/app.ts',
vite-plugin-ruby:config 'entrypoints/application.js': '/path/to/project/app/frontend/entrypoints/application.js',
vite-plugin-ruby:config 'entrypoints/i18n.ts': '/path/to/project/app/frontend/entrypoints/i18n.ts',
vite-plugin-ruby:config 'entrypoints/inertia.ts': '/path/to/project/app/frontend/entrypoints/inertia.ts',
vite-plugin-ruby:config 'assets/company-event-bg.jpg': '/path/to/project/app/frontend/assets/company-event-bg.jpg',
vite-plugin-ruby:config 'assets/company-footer-logo.png': '/path/to/project/app/frontend/assets/company-footer-logo.png',
vite-plugin-ruby:config 'assets/company-header-logo.png': '/path/to/project/app/frontend/assets/company-header-logo.png',
vite-plugin-ruby:config 'assets/company-logo.jpg': '/path/to/project/app/frontend/assets/company-logo.jpg',
vite-plugin-ruby:config 'assets/inertia.svg': '/path/to/project/app/frontend/assets/inertia.svg',
vite-plugin-ruby:config 'assets/vite_ruby.svg': '/path/to/project/app/frontend/assets/vite_ruby.svg',
vite-plugin-ruby:config 'assets/vue.svg': '/path/to/project/app/frontend/assets/vue.svg'
vite-plugin-ruby:config }
vite-plugin-ruby:config } +0ms

VITE v5.4.21 ready in 1217 ms
```

### Screenshots 📷

_Provide console or browser screenshots of the problem_.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.