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

[feat]: Add Support for Custom Vite Configuration #65

Closed
Quirkkle opened this issue Nov 2, 2024 · 2 comments
Closed

[feat]: Add Support for Custom Vite Configuration #65

Quirkkle opened this issue Nov 2, 2024 · 2 comments
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature

Comments

@Quirkkle
Copy link

Quirkkle commented Nov 2, 2024

A clear and concise description of what the feature is

This feature enables users to create a vite.config.ts file within the plugin/server directory, allowing for the enhancement and customization of the Vite configuration.

Why should this feature be included?

By supplementing the default configuration, developers can tailor build options, plugins, and other settings specific to their project needs, facilitating a more flexible development environment.

Please provide an example for how this would work

some-plugin/server/vite.config.ts

import { mergeConfig } from "vite";

export default (config) => {
  return mergeConfig(config, {
    // Vite configuration
  });
};
@Quirkkle Quirkkle added the issue: enhancement Issue suggesting an enhancement to an existing feature label Nov 2, 2024
@Quirkkle
Copy link
Author

Quirkkle commented Nov 2, 2024

I discovered a solution utilizing @strapi/pack-up, which operates under the hood of this tool.

For anyone encountering this issue:

Create a packup.config.ts in the root of your plugin

import { defineConfig } from '@strapi/pack-up';

export default defineConfig({
  // Vite configuration
});

Then, build your plugin using the following command:

npx @strapi/pack-up@latest build

@Quirkkle Quirkkle closed this as completed Nov 2, 2024
@sargreal
Copy link

While it is possible to work around this missing feature, I would really love to have this supported!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants