Comments (3)
Just some further info, although I'm still lost as to how to fix this problem:
On Windows
When running the penthouse.js
standalone, if I just let the output be printed in the console, then it works (no extra line breaks). (same in Cygwin and Window's CMD).
./phantomjs js/penthouse.js http://192.168.1.249/criticalpathcssgenerator/ test.css
If I redirect the output to a new file however, then additional line breaks appear (as shown in last post).
./phantomjs js/penthouse.js http://192.168.1.249/criticalpathcssgenerator/ test.css > extra-linebreaks.css
This is also what happens when running via f.e. Grunt.
from penthouse.
I'll come back to this later, but for now I'm sure the problem has to do with newline encoding; something in the penthouse.js
scripts (most likely fs) converting Windows style newlines (\r\n
) to Nix style (\n
), and then whenever the content gets rewritten to a Windows file the conversion goes wrong (becomes \r\r\n
)?.
I don't know much about this topic... Perhaps the answer to this problem is obvious to someone, - @kopseng?
from penthouse.
Current fix for this now is simply replacing any existing \r\n
initially with \n
- this solves the problem. There might be more elegant solutions out there though..
Fixed in: a1dc313
from penthouse.
Related Issues (20)
- Cannot read property 'width' of null
- Media queries in the generated .css file see seem inserted in the wrong line numbers HOT 6
- The media query `@media screen and (min-device-width: 20cm) and (min-aspect-ratio: 1/1)` is not inserted in the generated .ccs file. HOT 2
- Error: Failed to launch the browser process! on travis CI HOT 1
- why it crops critical css generated file? HOT 3
- What is CSSstring HOT 5
- Page speed insights CLS time on desktop get increased after resolving render blocking errors HOT 1
- Chrome processes HOT 4
- Output Wrong CSS HOT 1
- not finishing in Docker environment HOT 1
- Puppeteer Update HOT 3
- TypeError: Cannot read property 'clear' of undefined HOT 2
- Navigation timeout infinitely
- bug(iframes): timed out if lazy loaded iframes HOT 2
- Display none elements do not get added to critical
- Puppeteer screenshot works, but not penthouse HOT 2
- forceExclude is ignored / not working
- CSS selectors like `:where()` are not included in generated critical css HOT 1
- The generated CSS is too big and include many unused CSS
- Configuration to extract below the fold critical CSS
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 penthouse.