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: configurable src directory #292

Merged
merged 7 commits into from
Sep 9, 2024
Merged

Conversation

ojvribeiro
Copy link
Owner

@ojvribeiro ojvribeiro commented Sep 8, 2024

Configurable src directory

Note

This is a non-breaking change feature, so the default src directory is still the same as the project root directory.

This PR introduces a new dirs.src option to the Vulmix configuration file. This option allows you to specify the directory where the application source code is located.

The application source code includes the following files and directories:

  • assets/ directory
  • components/ directory
  • composables/ directory
  • layouts/ directory
  • pages/ directory
  • plugins/ directory
  • 404.vue file
  • app.vue file

Another example of application code are stores from Pinia or any other state management library.

You can use the @ alias to import files from the src directory. For example, say you have set you src directory to be /src and you want to access a Pinia store from src/stores directory. You can do it like this:

import { useMyStore } from '@/stores/my-store'

Warning

The ~ still points to the project root directory.

@ojvribeiro ojvribeiro added enhancement New feature or request 🍰 nice-to-have labels Sep 8, 2024
@ojvribeiro ojvribeiro self-assigned this Sep 8, 2024
@ojvribeiro ojvribeiro linked an issue Sep 8, 2024 that may be closed by this pull request
@ojvribeiro ojvribeiro added beta preview This PR is available in the latest preview version labels Sep 9, 2024
@ojvribeiro ojvribeiro merged commit f930b25 into main Sep 9, 2024
@ojvribeiro ojvribeiro deleted the feat/configurable-src-directory branch September 9, 2024 02:40
@ojvribeiro ojvribeiro mentioned this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta enhancement New feature or request 🍰 nice-to-have preview This PR is available in the latest preview version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable /src directory
1 participant