Comments (3)
Hello @griable,
thanks for your example, i'm now using webpack to compile css.
But here is what I used to have a an error overlay without this plugin:
.pipe($.sass())
.on('error', function (err) {
const error = `
<div class="bs-fullscreen"
style="position: fixed;
top: 0;
left: 0;
width: 100%;
background: rgba(0,0,0,.85);
height:
100vh;
color: #e8e8e8;
text-align: left;
white-space: pre;
font-family: Menlo, Consolas, monospace; font-size: 13px; padding: 10px; line-height: 1.2;">
<p><span style="background-color:#E36049; color:#fff; padding:2px 4px; border-radius: 2px; text-transform: uppercase">ERROR</span> in ${err.relativePath} on line ${err.line}:${err.column} </p>
<p>${err.messageOriginal}</p>
</div>
`;
browserSync.notify(error, 100000);
this.emit('end');
})
from bs-fullscreen-message.
Hi @martinherweg,
Interesting implementation. I'm actually now using your version because of the flexibility it offers and currently unaccepted pull requests of this project (overflow issue).
Thanks a lot for sharing.
from bs-fullscreen-message.
Hi @martinherweg,
Here's how I managed to make it. Please share if you manage to improve it in some way!
return gulp.src(config.styles.files)
.pipe(sass())
.on('data', function(err) {
browserSync.sockets.emit('fullscreen:message:clear')
})
.on('error', function(err) {
browserSync.sockets.emit('fullscreen:message', {
title: "Sass Error:",
body: stripAnsi(err.messageFormatted),
timeout: 100000
})
return sass.logError.call(this, err)
})
.pipe(gulp.dest(path.resolve(config.styles.dest)))
.pipe(browserSync.stream());
from bs-fullscreen-message.
Related Issues (2)
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 bs-fullscreen-message.