We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello.
May be i misunderstood something, but, is there any solution to make it work with external css , i mean <link rel="stylesheet" href="./style.css" />
<link rel="stylesheet" href="./style.css" />
Because if i have many templates , i don't want to copy/paste <style>...<style> in each html template.
Thanks in advance
The text was updated successfully, but these errors were encountered:
You have to use the url config property.
// import or require fs/promises + other modules const baseUrl = url.pathToFileURL(__dirname + path.sep).toString(); (async () => { const htmlFile = path.join(__dirname, 'index.html'); const html = await fs.readFile(htmlFile, { encoding: 'utf-8' }); const body = await inlineCss( `<link href="./style.css" type="text/css" rel="stylesheet">${html}`, { url: baseUrl }, ); console.log(body); })();
Sorry, something went wrong.
No branches or pull requests
Hello.
May be i misunderstood something, but,
is there any solution to make it work with external css , i mean
<link rel="stylesheet" href="./style.css" />
Because if i have many templates , i don't want to copy/paste <style>...<style> in each html template.
Thanks in advance
The text was updated successfully, but these errors were encountered: