cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Update post_gen_project.py to remove project.css when a bundler is used

Open leducvin opened this issue 6 months ago • 0 comments

Add remove_project_css function to remove static/css/project.css in case a bundler is used.

Description

Proposing to remove static/css/project.css whenever Webpack or Gulp are used.

Note: I've tested this with Webpack only. I'm not familiar enough with Gulp to know if it's to going to function similarly to Webpack in this respect -- I'm assuming so. I'm hoping someone can confirm this.

If Gulp needs the project.css file, then we should move the call remove_project_css() to here, in handle_js_runner(...) : https://github.com/cookiecutter/cookiecutter-django/blob/98bcde07e7521efdbb1bbd7129fd3c51914bf187/hooks/post_gen_project.py#L156

to only remove it if Webpack is used.

Checklist:

  • [NA] I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • [x] I've updated the documentation or confirm that my change doesn't require any updates

Rationale

Fix #5862

When a bundler is used, the project.css file is not used. It's sufficient to keep only static/sass/project.scss.

leducvin avatar May 30 '25 16:05 leducvin