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

Pass filename to PostCSS correctly #243

Merged
merged 1 commit into from Aug 8, 2017
Merged

Pass filename to PostCSS correctly #243

merged 1 commit into from Aug 8, 2017

Conversation

emmatown
Copy link
Member

@emmatown emmatown commented Aug 8, 2017

Closes #242

What:

Pass filename to PostCSS correctly so browserslist can read configs correctly.

Why:

#242

How:

For tagged template literals: don't objectify the root node before passing it to the prefixer so that source nodes remain.
For objects: create an Input object and set it on the root node before passing it to the prefixer. (it's pretty hacky)

Checklist:

  • Documentation N/A
  • Tests
  • Code complete

@codecov-io
Copy link

codecov-io commented Aug 8, 2017

Codecov Report

Merging #243 into master will increase coverage by 0.03%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #243      +/-   ##
==========================================
+ Coverage   90.26%   90.29%   +0.03%     
==========================================
  Files          20       20              
  Lines         966      969       +3     
  Branches      261      261              
==========================================
+ Hits          872      875       +3     
  Misses         76       76              
  Partials       18       18
Impacted Files Coverage Δ
src/babel.js 97.74% <100%> (ø) ⬆️
src/parser.js 95% <100%> (ø) ⬆️
src/ast-object.js 89.36% <75%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae09c36...eda432e. Read the comment docs.

const prefixedStyle = expandCSSFallbacks(prefixer(style))
const parsedStyle = postcssJs.parse(style)
parsedStyle.source = {}
parsedStyle.source.input = new Input(parsedStyle.toString(), {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever!

@tkh44 tkh44 merged commit 844b449 into master Aug 8, 2017
@tkh44 tkh44 deleted the fix-browserslist branch August 8, 2017 16:46
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

Successfully merging this pull request may close these issues.

Autoprefixer ignores configuration
3 participants