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

JS build with unused django app #65

Open
Supermanu opened this issue Aug 27, 2024 · 2 comments
Open

JS build with unused django app #65

Supermanu opened this issue Aug 27, 2024 · 2 comments

Comments

@Supermanu
Copy link
Contributor

Hi,
Currently in my project, we have multiple django applications with different entry points. In each application we have a folder static/app/js/…. In order to find the entry points in the vite config file we use globSync("*/static/*/js/*.js") which works almost perfectly. In deed, if we remove the app in django with the INSTALLED_APPS variable but not the files, vite cannot build. Like this (student_absence_teacher being the django app deactivated) :

x Build failed in 40ms
error during build:
Could not resolve entry module "student_absence_teacher/js/student_absence_teacher.js".
    at getRollupError (file:///home/manuel/Developpement/Python/happyschool/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///home/manuel/Developpement/Python/happyschool/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at ModuleLoader.loadEntryModule (file:///home/manuel/Developpement/Python/happyschool/node_modules/rollup/dist/es/shared/node-entry.js:19123:20)
    at async Promise.all (index 0)

Is there a way, without modifying the vite.config.js file, to build nevertheless?

@protibimbok
Copy link
Owner

Do you mean you want to build the assets from APPS that are not installed?

@Supermanu
Copy link
Contributor Author

Yes, that would be one way to solve my case as I often activate/deactivate django apps. Another way would be to have in the vite.config.js access to the activated django apps, so I can exclude them from the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants