addyosmani / addyosmani/critical

@import being removed entirely

Offen
#456 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
10.3k
Forks
390
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi there, I use `@import` for importing Adobe fonts to my site, however it appears that critical is removing my import statements in both the critical and uncritical CSS. Is there a way to keep it in?

Here's my gulp code:
```
const extractCriticalCSS = async () => {
return src('./dist/templates/**/*.html')
.pipe(flatmap((stream, file) => {
log("Extracting critical CSS for " + file.relative + "...");

const criticalPath = file.dirname + "/" + file.stem + "-critical.css";
const uncriticalPath = file.dirname + "/" + file.stem + ".css";

return stream
.pipe(critical({
inline: true,
base: './dist/',
target: {
css: criticalPath,
uncritical: uncriticalPath
},
extract: true,
ignore: {
atrule: ['@font-face']
}
}))
.on('error', err => {
log.error(err.message);
})
}))
.pipe(dest('./dist/templates'))
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.