Skip to content

Run production builds for non "production" mode #228

Closed
@bluwy

Description

@bluwy

Describe the bug

When the build mode is not "production", vite-plugin-svelte assumes that it is not a production build, so it produces a dev build, which leads to a large bundle size (among other things).

This was raise by @antony on Discord. The current workaround is to have this in the svelte config:

const isDevelopmentMode = process.env.NODE_ENV === 'development'
  compilerOptions: {
    dev: isDevelopmentMode
  },
  hot: isDevelopmentMode,
  vite: {
    mode: process.env.NODE_ENV
  }

Reproduction

isProduction: viteEnv.mode === 'production',

We shouldn't be checking the env mode as production here

Logs

No response

System Info

Not related.

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions