Comments (6)
but rtlcss only maps back to the Sass' CSS output instead of the original Sass files.
This is the expected behavior, since SASS CSS output is RTLCSS input.
the generated source map file only contains the text "undefined" and the source map itself is inlined as a data URI in the output CSS.
As of postcss 3.0 map.inline
is enabled by default, which will cause source maps to be embedded inside the processed file, you need to explicitly set it to false
.
rtlcss([...]).process(css, {
from: 'ltr.css',
to: 'rtl.css',
map: { inline: false },
});
from rtlcss.
but rtlcss only maps back to the Sass' CSS output instead of the original Sass files.
This is the expected behavior, since SASS CSS output is RTLCSS input.
However, the Sass output also contains a source map, so it would be possible to map back to the original source, which makes debugging much easier. Currently we have to grep the whole project because we have lots of small Sass modules. Other tools like Uglify support reusing intermediate source maps, too (e.g. so you can see the original Coffee source instead of some unreadable Coffee compiler output).
As of postcss 3.0 map.inline is enabled by default, which will cause source maps to be embedded inside the processed file, you need to explicitly set it to false.
I forgot to mention, we're using the cli (via a custom build system written in Python). The cli's source map output seems to be broken. If the source map is supposed to be inline, why does it generate a .map file with "undefined"? Otherwise the cli should set inline: false.
from rtlcss.
so it would be possible to map back to the original source
Sure, but still you need to pass the previous source map too
rtlcss([...]).process(css, {
from: 'ltr.css',
to: 'rtl.css',
map: { 'inline': false, 'prev': previousMap },
});
The cli's source map output seems to be broken. If the source map is supposed to be inline, why does it generate a .map file with "undefined"? Otherwise the cli should set inline: false.
True, the CLI was written prior to postcss 3.0 release, it should be updated to set inline:false
.
However, to make sure the fix will solve your problem, can you try running your build with a modified version of the CLI. Just update this line to:
opt.map = {inline:false, prev:true};
And make sure your config has map:true
.
Thanks.
from rtlcss.
@wkornewald According to my tests, when the processed CSS file contains a reference to an external map file then setting map
config option to true
is sufficient enough. Otherwise you need to set it to {inline:false}
.
from rtlcss.
@MohammadYounes Thanks. I've updated our build system and now it seems to work fine. The only issue left is that apparently on Windows there is a mixture of line endings in the generated css file. The code has \r\n, but the sourceMappingURL annotation comment uses \n.
from rtlcss.
That's caused by postcss, see this line.
from rtlcss.
Related Issues (20)
- Ignore import not working HOT 5
- The background-position declarations are flipped differently on version v4.0.0 HOT 3
- background-position: HOT 2
- Integrating with Codeigniter
- Bootstrap 5.2 LTR and RTL at the same time (scss with Laravel vite) HOT 14
- using blacklist HOT 3
- aliases options don't work HOT 1
- Don't process data URLs
- Support src() with processUrls
- processUrls shouldn't process non-URL expressions in at-rules
- Bootstrap RTL and LTR at the same time HOT 2
- Unknown word error when "//' is used for commenting in scss files. HOT 1
- issue with media queries and onlyDiff option HOT 1
- This rtlcss package how to use in Laravel vite.config.js HOT 2
- RTLCSS Online
- RTLCSS errors when processing a value directive marked as important
- Tabbed menu not compatible HOT 5
- Can't deal with CSS
- Can't handle CSS style without semicolon HOT 2
- After compilation, ignore is invalid HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtlcss.