From 86003fe39242be5e0bceac09fe1a72c1743898c0 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Wed, 17 Jan 2024 02:52:14 +0000 Subject: [PATCH] Fix deprecated sass import --- src/build.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build.js b/src/build.js index 34f4b44..804a62d 100644 --- a/src/build.js +++ b/src/build.js @@ -1,19 +1,19 @@ +import fs from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; import posthtml from 'posthtml'; import posthtmlInclude from 'posthtml-include'; import { posthtmlInsertAt } from 'posthtml-insert-at'; import htmlnano from 'htmlnano'; import postcss from 'postcss'; import postcssUrl from 'postcss-url'; -import sass from 'sass'; +import { compileAsync } from 'sass'; import esbuild from 'esbuild'; import copy from 'recursive-copy'; -import fs from 'fs/promises'; -import { fileURLToPath } from 'url'; const main = async () => { // Compile our SCSS w/ sass, and inline the images w/ postcss-url const styleSource = fileURLToPath(new URL('./index.scss', import.meta.url)); - const style = await sass.compileAsync(styleSource, { style: 'compressed' }) + const style = await compileAsync(styleSource, { style: 'compressed' }) .then(({ css }) => postcss() .use(postcssUrl({ url: 'inline', encodeType: 'base64' })) .process(css, { from: styleSource }));