Skip to content

Commit

Permalink
Merge pull request #57 from nhsuk/fix-sass-compile
Browse files Browse the repository at this point in the history
Do not compile sass files that start with an underscore
  • Loading branch information
davidhunter08 authored Apr 24, 2024
2 parents b18a824 + 84dab63 commit 160603c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path'
import nunjucks from 'nunjucks'
import sass from 'sass'
import { EleventyHtmlBasePlugin } from '@11ty/eleventy'
Expand All @@ -23,7 +24,11 @@ export default function (eleventyConfig) {
eleventyConfig.addTemplateFormats('scss')
eleventyConfig.addExtension('scss', {
outputFileExtension: 'css',
compile: async function (inputContent) {
compile: async function (inputContent, inputPath) {
let parsed = path.parse(inputPath)
if (parsed.name.startsWith('_')) {
return
}
let result = sass.compileString(inputContent, {
// Allow us to import scss files relative to the project root
loadPaths: ['.']
Expand Down

0 comments on commit 160603c

Please sign in to comment.