Open webakimbo opened 8 years ago
I'd really appreciate an answer to this as well. I've tried different folder structures and regexes, to no avail. TIA
The pollution of partial files can be fixed within your brunch config. For example, you configuration might look like this...
exports.config =
...
conventions:
ignored: [
/[\\/]_/
/^app\/markup\/partials/
]
...
...which tells Brunch not to compile any files starting with underscore or in the partials folder. This will probably solve your second issue with the error of path formatting, in which the regular expression returns no match, and therefore the attempt to read the matches at position 3 throws an error. A formatPath
method that is less likely to fail would be a simpler string replace, as in...
formatPath: (path) -> path.replace("app/markup/", "")
Not sure if this is a bug or a feature request, but getting the same error as with this closed issue.
Assume I have two files,
index.jade
and_some_partial.jade
, in /app/markup.My config looks like this:
And in index.jade:
The plugin compiles both to html files in /public... but then the production build is polluted with a partial file (
/public/_some_partial.html
) that shouldn't be served by itself.My expectation was that jade would perform the includes first, then compile to a single static file (
/public/index.html
) that gets served. If I exclude partials from formatPath:...I get the "cannot read property '3' of null" error, and the build fails.