-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix a number of issues with Webpack #808
Conversation
This is a POC that shows building webpack through standard `setup.py` commands. Any call to `setup.py build` or `bdist` or `sdist` will trigger a Webpack build of the assets first. A non-zero exit code will halt the process. Also, moved the `npm run dev` command, which here is `python setup.py watch`, though there is perhaps something better here. There is already `python setup.py develop`, which has a separate function, so I don't want to collide there. Example output here: https://gist.github.com/agjohnson/cdaab364fe598daa7f3bef750cfb84dd Refs #797
My build cannot find fontawesome:
This looks similar to an issue with tilde in If I downgrade |
Hrm odd. I'll poke this on my environment to see what I find. |
Co-Authored-By: Jesse Tan <[email protected]>
Co-Authored-By: Jesse Tan <[email protected]>
Run webpack js through Prettier JS formatter
Looks like it is not unique to my setup: #820 |
@agjohnson how is the progress on this? It is one of the things that is holding back a release. |
I haven't had time in Sep to focus on the theme, but have some changes on our roadmap that I'm assigned to. I'll be getting back to some of this work in a week or so. If you find a fix, feel free to jump in -- I still have not tried to reproduce the error yet even, so I'm not sure what I'll hit yet. |
Add webpack commands into setup.py
Thanks @agjohnson, sounds good. |
Ensure `setup.py build` and `setup.py test` work on a clean repo
These look resolved to me
I don't have this issue and the configuration worked as-is for me.
The fonts "work" but they are duplicated. More or less the same fonts exist in
|
Just to add to this I get the same error as @jessetan when running these commands:
@davidfischer is this what you are doing or is there another way to do it? [edit:] on Debian 10.1, Python 3.7.3, NPM 6.9.0 |
@davidfischer perhaps it is different environments. I use a pipenv shell on macOS 10.13.6 with npm 6.12.0, Python 3.7.3. The error appears when I run |
I looked a bit more into
Don't know if that helps? |
This is the version that I had installed so that may explain things. I had a
|
I created a PR that could merge into this one that commits the |
I am out of my depth on all this npm stuff, but it would be great if someone could figure out what causes the problem (since |
@pedro-w what is problem? |
@evilebottnawi thanks for the quick response. If you look at this comment the problem is that sphinx_rtd_theme's build system can't resolve the fontawesome fonts. Further, it seems that with |
@pedro-w maybe you can create minimum reproducible test repo and open issue in sass-loader? |
I believe if you change the import here sphinx_rtd_theme/src/sass/theme.sass Line 31 in ddf840c
to @import ~font-awesome/scss/font-awesome then it will solve the issues with sass-loader versions (7.1 and earlier vs 7.2 and later)
|
I created a small PR that merges into this one based on your suggestion. It worked for me and I'd be happy to be able to take a later version. #830 |
Small fixes to setup.py
Looking through some of the remaining comments, there are already some fixes in master that are not in this branch.
If there is any feedback or if anyone else wants to get review in, I'd like to get this merged soon. |
A few of these squeezed by QA and testing: * badge_only.css was copied to the static output path, it wasn't actually building it seems. Added second entry for this to make it easier. * jQuery was not being treated as an external library and was vendored into our JS bundle! * Having the fonts in a relative path from CSS ('../fonts'), causes CORS issues. Moved `/fonts` to `/sphinx_rtd_theme/static/css/fonts` essentially * The dev server wasn't compiling assets consistently for me, tuned it hopefully Requires #807
Adds moved font files
6ab0ff6
to
6cfc95f
Compare
I think we accidentally merged this into |
Should be merged manually now |
A few of these squeezed by QA and testing:
actually building it seems. Added second entry for this to make it
easier.
into our JS bundle!
issues. Moved
/fonts
to/sphinx_rtd_theme/static/css/fonts
essentially. See Fonts are different between local html and readthedocs.org #782js/badge_only.js
, which I believe is for using CSS through JS. This is a webpack 4 thing and it can't be removed. I say disregard it for now.Requires #807, based on that until it's merged, then can be repointed to master
Refs #782