-
-
Notifications
You must be signed in to change notification settings - Fork 210
fix: allow inlined sourceMaps when sourceMap or devtool are truthy #475
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #475 +/- ##
==========================================
- Coverage 97.50% 97.48% -0.02%
==========================================
Files 5 5
Lines 240 239 -1
Branches 76 77 +1
==========================================
- Hits 234 233 -1
Misses 6 6
Continue to review full report at Codecov.
|
1684ad5
to
0096380
Compare
Previously when either the sourceMap option or devtool was truthy inlining of sourceMaps was not possible.
0096380
to
d43aa3d
Compare
test/sourceMap.test.js
Outdated
{ | ||
sourceMap: true, | ||
postcssOptions: { | ||
sourceMap: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need 👍
processOptions.map = { inline: false, annotation: false }; | ||
if ( | ||
typeof processOptions.map === 'undefined' || | ||
typeof processOptions.map === 'boolean' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processOptions.map: true
means as the same postcss(plugins).process(content, { from, map: true })
, there is not docs for this, but it should generate inline map as I remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To generate a new source map with the default options, simply set map: true. This will generate an inline source map that contains the source content. If you don’t want the map inlined, you can set map.inline: false.
processOptions.map = { inline: true }; | ||
} | ||
|
||
processOptions.map.prev = sourceMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it is breaking change, now you need always to set sourceMap: true
if you need source maps, but it is invalid , in some cases I don't need webpack source maps, I need only postcss source maps (for example generate library with css and relative urls in sources)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I can amend the logic to check for either useSourceMaps
or postcssOptions.map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you want to achieve? I don't understand what you are trying to do, if you want to generate inline source map just set postcssOptions.map: true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment if devtool is set you cannot “inline” a sourcemap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I understood the problem, I'm working on it
@alan-agius4 After this PR #476 - you should not use |
Thanks |
@alan-agius4 feel free to feedback |
@evilebottnawi, the latest patch version fixes the problem. Thanks |
This PR contains a:
Motivation / Use-Case
Previously when either the sourceMap option or devtool was truthy
inlining of sourceMaps was not possible.
Breaking Changes
Additional Info