Skip to content
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

@import being removed entirely #456

Open
igloohome-web opened this issue Jul 7, 2020 · 0 comments
Open

@import being removed entirely #456

igloohome-web opened this issue Jul 7, 2020 · 0 comments

Comments

@igloohome-web
Copy link

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'))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant