Skip to content

[Vite] Use the same generated config pattern as with webpack #12115

Closed

Description

@Artur-

There should be a vite.generated.ts which we always overwrite and then a vite.config.ts that is only generated if it does not exist.

Activity

  1. Artur- commented on Oct 27, 2021

    @Artur-
    MemberAuthor

    Maybe this would work

    vite.generated.ts

    /**
     * NOTICE: this is an auto-generated file
     *
     * This file has been generated by the `flow:prepare-frontend` maven goal.
     * This file will be overwritten on every run. Any custom changes should be made to vite.config.ts
     */
    
    import { UserConfigExport } from 'vite';
    
    ...
    
    export const vaadinConfig: UserConfigExport = {
       ...
    };

    vite.config.ts

    import { defineConfig, UserConfigExport } from 'vite';
    import { vaadinConfig } from './vite.generated';
    
    // https://vitejs.dev/config/
    const customConfig: UserConfigExport = {
    };
    
    export default defineConfig({ ...vaadinConfig, ...customConfig });
  2. Artur- commented on Oct 27, 2021

    @Artur-
    MemberAuthor

    There is actually a mergeConfig exported by Vite that we probably should use

  3. self-assigned this
    on Oct 29, 2021
  4. added 2 commits that reference this issue on Nov 1, 2021
    409e549
    8ac7cd5
  5. added a commit that references this issue on Nov 1, 2021
    4e28831
  6. vaadin-bot commented on Nov 12, 2021

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with platform 22.0.0.beta2 and is also targeting the upcoming stable 22.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions