-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Autoprefixer not working properly #497
Comments
Just realised changing
to
fixes the issue. At least the output now are
Still the question is: why this last part with |
Wow – I didn't understand what you were talking about, but was trying to get autoprefixer to spit out anything beyond this in my compiled template:
Turns out that while Is |
I'm just reading this thread, a year later (because the documentation is still wrong). What webassets need is an update to its documentation (and a new release!). I might start working on the first one. PS: Thank you for the tip! |
I take back my words. The lack of support for sourcemaps it's a serious problem. |
Here is a working solution for modern autoprefixer. First, install autoprefixer 9 because postcss command line interface has not yet caught up with autoprefixer 10 (postcss/autoprefixer#1358): npm install autoprefixer@^9 postcss-cli@^8 postcss@^8 Then, define custom filter: from subprocess import Popen, PIPE
def css_prefixer(_in, out, **kw):
# probably can be simplified...
cat = Popen(['cat'], stdin=PIPE, stdout=PIPE)
postcss = Popen(['npx', 'postcss', '--use', 'autoprefixer'], stdin=cat.stdout, stdout=PIPE, stderr=PIPE)
cat.stdin.write(_in.read().encode('utf-8'))
cat.stdout.close()
cat.terminate()
postcss.wait()
postcss_error = postcss.stderr.read().decode('utf-8')
if postcss_error:
raise ValueError(postcss_error)
output = postcss.stdout.read().decode('utf-8')
assert output
out.write(output)
# Bundle(..., filters=[css_prefixer]) Now the seemingly useless use of cat above is actually required, because the postcss does not implement the pipe interface correctly (postcss/postcss-cli#119). It's not surprising that the JS ecosystem is breaking fast and breaking a lot, but as long as they provide a CLI it is possible to easily use the newest version. |
In my flask application I have a setup like this
where I first installed
autoprefixer
byNow this is all working fine and dandy - at least one would think. But if
scss/all.scss
containsthen
packed.css
will outputinstead of the expected output:
Any suggestions?
The text was updated successfully, but these errors were encountered: