django-cms / djangocms-frontend

django CMS frontend is a plugin bundle for django CMS providing several components for the frontend, currently implemented with the popular Bootstrap 5 framework.
Other
51 stars 21 forks source link

Missing source maps #11

Closed marksweb closed 2 years ago

marksweb commented 2 years ago

I'm trying to build this into an app to deploy but my static collection is failing on missing files.

The CSS references source maps, but they're not actually in the repo.

Could we perhaps include the un-minified CSS alongside the minified files and source maps?

To clarify the error;

File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 134, in collect
    raise processed
  File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/django/contrib/staticfiles/storage.py", line 288, in _post_process
    content = pattern.sub(converter, content)
  File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/django/contrib/staticfiles/storage.py", line 187, in converter
    hashed_url = self._url(
  File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/django/contrib/staticfiles/storage.py", line 126, in _url
    hashed_name = hashed_name_func(*args)
  File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/django/contrib/staticfiles/storage.py", line 338, in _stored_name
    cache_name = self.clean_name(self.hashed_name(name))
  File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/base/utils/staticfiles_storage.py", line 86, in hashed_name
    hashed_name = super().hashed_name(
  File "/Users/mwalker/Sites/consoles/.venv/lib/python3.9/site-packages/django/contrib/staticfiles/storage.py", line 88, in hashed_name
    raise ValueError("The file '%s' could not be found with %r." % (filename, self))
ValueError: The file 'djangocms_frontend/css/button_group.css.map' could not be found with <base.utils.staticfiles_storage.SourceMapManifestStorage object at 0x7fe25be77910>.
fsbraun commented 2 years ago

Sass creates the .map file. I have added it to the repo in the latest commit https://github.com/fsbraun/djangocms-frontend/commit/352690886a298a757af92087da02635ea089e1af.

marksweb commented 2 years ago

@fsbraun there are additional source maps for other css files.

How do you compile these? It might be worth adding the process to the repo incase people need to modify the styles.

fsbraun commented 2 years ago

Sorry, I oversaw base.css.map. (https://github.com/fsbraun/djangocms-frontend/commit/e0680268fe23d2a830a3d4bb3e1262b50d9d5dcd) The other files are uncompressed css and select2.css which is the css from Select2.js.

fsbraun commented 2 years ago

Wait, maybe select2.css is missing for an unknown reason.

fsbraun commented 2 years ago

Yes, I could create it. Now all .map files should be there: https://github.com/fsbraun/djangocms-frontend/commit/cb72d35026608b73e5e5ec46ce2db95a26587c63

fsbraun commented 2 years ago

@marksweb Maybe you can have a look at the gulpfile.js. I have not used it. Rather I compiled js with webpack and css with sass, respectively, by hand. Sass:

sass -scompressed base.scss ../../djangocms_frontend/static/djangocms_frontend/css/base.css

I did not use the build process for icons and I fear it would fail. For sass to work an installation of bootstrap is needed. Bootstrap 5 needs autoprefix which I believe is not part of the gulp process.