Skip to content

Commit

Permalink
fix: add support for ignored folders
Browse files Browse the repository at this point in the history
  • Loading branch information
barelyhuman committed Dec 8, 2024
1 parent 7a22b49 commit a46cb40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
File renamed without changes.
21 changes: 15 additions & 6 deletions lib/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { build } from 'esbuild'
import { marked } from 'marked'
import fs from 'node:fs'
import coffee from 'coffeescript'
import { dirname, extname, join, resolve } from 'node:path'
import { dirname, extname, join, relative, resolve, sep } from 'node:path'
import { transform as sucraseTransform } from 'sucrase'
import Mustache from 'mustache'
import glob from 'tiny-glob'
Expand Down Expand Up @@ -158,13 +158,22 @@ export async function compile(basePath, distPath, options) {
filesOnly: true,
absolute: true,
})
).filter(
(d) =>
d != resolve(layoutSource) &&
).filter((d) => {
const isLayout = d == resolve(layoutSource)
const isDist = distPath ? d.startsWith(resolve(distPath)) : false
const isTmp = d.startsWith(resolve('.tmp'))
const isInIgnoredFolder = relative(resolve(basePath), d)
.split(sep)[0]
.startsWith('_')
return (
!isInIgnoredFolder &&
!isLayout &&
!isTmp &&
!d.endsWith('.mustache') &&
!d.startsWith(resolve('node_modules')) &&
(distPath ? !d.startsWith(resolve(distPath)) : true),
)
!isDist
)
})

const transformersByExtensions = Object.assign(
{},
Expand Down

0 comments on commit a46cb40

Please sign in to comment.