Skip to content

bin/vite build should respect --mode option #584

@noxasch

Description

@noxasch
  • I have tried upgrading by running bundle update vite_ruby.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: pending triageSomething doesn't seem to be working, but hasn't been verified

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions