|
| 1 | +import coffee from 'coffeescript' |
1 | 2 | import { build } from 'esbuild' |
2 | 3 | import { marked } from 'marked' |
| 4 | +import Mustache from 'mustache' |
3 | 5 | import fs from 'node:fs' |
4 | | -import coffee from 'coffeescript' |
5 | | -import { dirname, extname, join, relative, resolve, sep } from 'node:path' |
| 6 | +import { |
| 7 | + basename, |
| 8 | + dirname, |
| 9 | + extname, |
| 10 | + join, |
| 11 | + relative, |
| 12 | + resolve, |
| 13 | + sep, |
| 14 | +} from 'node:path' |
6 | 15 | import { transform as sucraseTransform } from 'sucrase' |
7 | | -import Mustache from 'mustache' |
8 | 16 | import glob from 'tiny-glob' |
9 | | -import { svelteTransformer } from './transformers/svelteTransformer.mjs' |
10 | 17 | import { htmlProcessor } from './processors/htmlProcessor.mjs' |
11 | 18 | import { cssTransformer } from './transformers/cssTransformer.mjs' |
| 19 | +import { svelteTransformer } from './transformers/svelteTransformer.mjs' |
12 | 20 |
|
13 | 21 | const compileTemplate = (layout) => (vars) => Mustache.render(layout, vars) |
14 | 22 |
|
@@ -159,19 +167,19 @@ export async function compile(basePath, distPath, options) { |
159 | 167 | absolute: true, |
160 | 168 | }) |
161 | 169 | ).filter((d) => { |
162 | | - const isLayout = d == resolve(layoutSource) |
163 | 170 | const isDist = distPath ? d.startsWith(resolve(distPath)) : false |
164 | 171 | const isTmp = d.startsWith(resolve('.tmp')) |
165 | 172 | const isInIgnoredFolder = relative(resolve(basePath), d) |
166 | 173 | .split(sep)[0] |
167 | 174 | .startsWith('_') |
| 175 | + const isIgnoredFile = basename(d).startsWith('_') |
168 | 176 | return ( |
169 | 177 | !isInIgnoredFolder && |
170 | | - !isLayout && |
171 | 178 | !isTmp && |
172 | 179 | !d.endsWith('.mustache') && |
173 | 180 | !d.startsWith(resolve('node_modules')) && |
174 | | - !isDist |
| 181 | + !isDist && |
| 182 | + !isIgnoredFile |
175 | 183 | ) |
176 | 184 | }) |
177 | 185 |
|
|
0 commit comments